class Bifoldable :: (Type -> Type -> Type) -> Constraint
class Bifoldable p where
Bifoldable represents data structures with two type arguments which can be
A fold for such a structure requires two step functions, one for each type argument. Type class instances should choose the appropriate step function based on the type of the element encountered at each point of the fold.
Default implementations are provided by the following functions:
Note: some combinations of the default implementations are unsafe to use together - causing a non-terminating mutually recursive cycle. These combinations are documented per function.
bifoldr :: forall a b c. (a -> c -> c) -> (b -> c -> c) -> c -> p a b -> c
bifoldl :: forall a b c. (c -> a -> c) -> (c -> b -> c) -> c -> p a b -> c
bifoldMap :: forall m a b. Monoid m => (a -> m) -> (b -> m) -> p a b -> m