planet-mitchell-0.1.0: Planet Mitchell

Foldable

Synopsis

# Foldable

class Foldable (t :: * -> *) where #

Data structures that can be folded.

For example, given a data type

data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)

a suitable instance would be

instance Foldable Tree where
foldMap f Empty = mempty
foldMap f (Leaf x) = f x
foldMap f (Node l k r) = foldMap f l mappend f k mappend foldMap f r

This is suitable even for abstract types, as the monoid is assumed to satisfy the monoid laws. Alternatively, one could define foldr:

instance Foldable Tree where
foldr f z Empty = z
foldr f z (Leaf x) = f x z
foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l

Foldable instances are expected to satisfy the following laws:

foldr f z t = appEndo (foldMap (Endo . f) t ) z
foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
fold = foldMap id
length = getSum . foldMap (Sum . const  1)

sum, product, maximum, and minimum should all be essentially equivalent to foldMap forms, such as

sum = getSum . foldMap Sum

but may be less defined.

If the type is also a Functor instance, it should satisfy

foldMap f = fold . fmap f

which implies that

foldMap f . fmap g = foldMap (f . g)

Minimal complete definition

Methods

fold :: Monoid m => t m -> m #

Combine the elements of a structure using a monoid.

foldMap :: Monoid m => (a -> m) -> t a -> m #

Map each element of the structure to a monoid, and combine the results.

foldr :: (a -> b -> b) -> b -> t a -> b #

Right-associative fold of a structure.

In the case of lists, foldr, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:

foldr f z [x1, x2, ..., xn] == x1 f (x2 f ... (xn f z)...)

Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, foldr can produce a terminating expression from an infinite list.

For a general Foldable structure this should be semantically identical to,

foldr f z = foldr f z . toList

foldr' :: (a -> b -> b) -> b -> t a -> b #

Right-associative fold of a structure, but with strict application of the operator.

foldl' :: (b -> a -> b) -> b -> t a -> b #

Left-associative fold of a structure but with strict application of the operator.

This ensures that each step of the fold is forced to weak head normal form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite list to a single, monolithic result (e.g. length).

For a general Foldable structure this should be semantically identical to,

foldl f z = foldl' f z . toList

toList :: t a -> [a] #

List of elements of a structure, from left to right.

null :: t a -> Bool #

Test whether the structure is empty. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

length :: t a -> Int #

Returns the size/length of a finite structure as an Int. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

elem :: Eq a => a -> t a -> Bool infix 4 #

Does the element occur in the structure?

sum :: Num a => t a -> a #

The sum function computes the sum of the numbers of a structure.

product :: Num a => t a -> a #

The product function computes the product of the numbers of a structure.

Instances

all :: Foldable t => (a -> Bool) -> t a -> Bool #

Determines whether all elements of the structure satisfy the predicate.

and :: Foldable t => t Bool -> Bool #

and returns the conjunction of a container of Bools. For the result to be True, the container must be finite; False, however, results from a False value finitely far from the left end.

any :: Foldable t => (a -> Bool) -> t a -> Bool #

Determines whether any element of the structure satisfies the predicate.

asum :: (Foldable t, Alternative f) => t (f a) -> f a #

The sum of a collection of actions, generalizing concat.

asum [Just Hello, Nothing, Just World] Just Hello

concatMap :: Foldable t => (a -> [b]) -> t a -> [b] #

Map a function over all the elements of a container and concatenate the resulting lists.

find :: Foldable t => (a -> Bool) -> t a -> Maybe a #

The find function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or Nothing if there is no such element.

foldBy :: Foldable t => (a -> a -> a) -> a -> t a -> a #

Fold a value using its Foldable instance using explicitly provided Monoid operations. This is like fold where the Monoid instance can be manually specified.

foldBy mappend mempty ≡ fold

>>> foldBy (++) [] ["hello","world"]
"helloworld"


foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #

The foldM function is analogous to foldl, except that its result is encapsulated in a monad. Note that foldM works from left-to-right over the list arguments. This could be an issue where (>>) and the folded function' are not commutative.

foldM f a1 [x1, x2, ..., xm]

==

do
a2 <- f a1 x1
a3 <- f a2 x2
...
f am xm

If right-to-left evaluation is required, the input list should be reversed.

Note: foldM is the same as foldlM

foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m () #

Like foldM, but discards the result.

foldMapBy :: Foldable t => (r -> r -> r) -> r -> (a -> r) -> t a -> r #

Fold a value using its Foldable instance using explicitly provided Monoid operations. This is like foldMap where the Monoid instance can be manually specified.

foldMapBy mappend mempty ≡ foldMap

>>> foldMapBy (+) 0 length ["hello","world"]
10


foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #

Monadic fold over the elements of a structure, associating to the left, i.e. from left to right.

foldr1May :: Foldable t => (a -> a -> a) -> t a -> Maybe a #

foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b #

Monadic fold over the elements of a structure, associating to the right, i.e. from right to left.

for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f () #

for_ is traverse_ with its arguments flipped. For a version that doesn't ignore the results see for.

>>> for_ [1..4] print
1
2
3
4


group :: (Foldable f, Eq a) => f a -> [NonEmpty a] #

The group function takes a stream and returns a list of streams such that flattening the resulting list is equal to the argument. Moreover, each stream in the resulting list contains only equal elements. For example, in list notation:

'group' $'cycle' "Mississippi" = "M" : "i" : "ss" : "i" : "ss" : "i" : "pp" : "i" : "M" : "i" : ... groupAllWith :: Ord b => (a -> b) -> [a] -> [NonEmpty a] # groupAllWith operates like groupWith, but sorts the list first so that each equivalence class has, at most, one list in the output groupBy :: Foldable f => (a -> a -> Bool) -> f a -> [NonEmpty a] # groupBy operates like group, but uses the provided equality predicate instead of ==. groupWith :: (Foldable f, Eq b) => (a -> b) -> f a -> [NonEmpty a] # groupWith operates like group, but uses the provided projection when comparing for equality inits :: Foldable f => f a -> NonEmpty [a] # The inits function takes a stream xs and returns all the finite prefixes of xs. insert :: (Foldable f, Ord a) => a -> f a -> NonEmpty a # insert x xs inserts x into the last position in xs where it is still less than or equal to the next element. In particular, if the list is sorted beforehand, the result will also be sorted. maximumByMay :: Foldable t => (a -> a -> Ordering) -> t a -> Maybe a # maximumMay :: (Foldable t, Ord a) => t a -> Maybe a # minimumByMay :: Foldable t => (a -> a -> Ordering) -> t a -> Maybe a # minimumMay :: (Foldable t, Ord a) => t a -> Maybe a # msum :: (Foldable t, MonadPlus m) => t (m a) -> m a # The sum of a collection of actions, generalizing concat. As of base 4.8.0.0, msum is just asum, specialized to MonadPlus. notElem :: (Foldable t, Eq a) => a -> t a -> Bool infix 4 # notElem is the negation of elem. or :: Foldable t => t Bool -> Bool # or returns the disjunction of a container of Bools. For the result to be False, the container must be finite; True, however, results from a True value finitely far from the left end. sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f () # Evaluate each action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see sequenceA. tails :: Foldable f => f a -> NonEmpty [a] # The tails function takes a stream xs and returns all the suffixes of xs. traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f () # Map each element of a structure to an action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see traverse. # Foldable1 class Foldable t => Foldable1 (t :: * -> *) where # Methods fold1 :: Semigroup m => t m -> m # foldMap1 :: Semigroup m => (a -> m) -> t a -> m # toNonEmpty :: t a -> NonEmpty a # Instances  Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Par1 m -> m #foldMap1 :: Semigroup m => (a -> m) -> Par1 a -> m #toNonEmpty :: Par1 a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Complex m -> m #foldMap1 :: Semigroup m => (a -> m) -> Complex a -> m #toNonEmpty :: Complex a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Min m -> m #foldMap1 :: Semigroup m => (a -> m) -> Min a -> m #toNonEmpty :: Min a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Max m -> m #foldMap1 :: Semigroup m => (a -> m) -> Max a -> m #toNonEmpty :: Max a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => First m -> m #foldMap1 :: Semigroup m => (a -> m) -> First a -> m #toNonEmpty :: First a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Last m -> m #foldMap1 :: Semigroup m => (a -> m) -> Last a -> m #toNonEmpty :: Last a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Identity m -> m #foldMap1 :: Semigroup m => (a -> m) -> Identity a -> m #toNonEmpty :: Identity a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Dual m -> m #foldMap1 :: Semigroup m => (a -> m) -> Dual a -> m #toNonEmpty :: Dual a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Sum m -> m #foldMap1 :: Semigroup m => (a -> m) -> Sum a -> m #toNonEmpty :: Sum a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Product m -> m #foldMap1 :: Semigroup m => (a -> m) -> Product a -> m #toNonEmpty :: Product a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => NonEmpty m -> m #foldMap1 :: Semigroup m => (a -> m) -> NonEmpty a -> m #toNonEmpty :: NonEmpty a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Tree m -> m #foldMap1 :: Semigroup m => (a -> m) -> Tree a -> m #toNonEmpty :: Tree a -> NonEmpty a # Instance detailsDefined in Numeric.Log Methodsfold1 :: Semigroup m => Log m -> m #foldMap1 :: Semigroup m => (a -> m) -> Log a -> m #toNonEmpty :: Log a -> NonEmpty a # Foldable1 (V1 :: * -> *) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => V1 m -> m #foldMap1 :: Semigroup m => (a -> m) -> V1 a -> m #toNonEmpty :: V1 a -> NonEmpty a # Foldable1 ((,) a) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => (a, m) -> m #foldMap1 :: Semigroup m => (a0 -> m) -> (a, a0) -> m #toNonEmpty :: (a, a0) -> NonEmpty a0 # Foldable1 f => Foldable1 (Cofree f) Instance detailsDefined in Control.Comonad.Cofree Methodsfold1 :: Semigroup m => Cofree f m -> m #foldMap1 :: Semigroup m => (a -> m) -> Cofree f a -> m #toNonEmpty :: Cofree f a -> NonEmpty a # Foldable1 f => Foldable1 (Free f) Instance detailsDefined in Control.Monad.Free Methodsfold1 :: Semigroup m => Free f m -> m #foldMap1 :: Semigroup m => (a -> m) -> Free f a -> m #toNonEmpty :: Free f a -> NonEmpty a # Foldable1 f => Foldable1 (Yoneda f) Instance detailsDefined in Data.Functor.Yoneda Methodsfold1 :: Semigroup m => Yoneda f m -> m #foldMap1 :: Semigroup m => (a -> m) -> Yoneda f a -> m #toNonEmpty :: Yoneda f a -> NonEmpty a # Foldable1 f => Foldable1 (Lift f) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Lift f m -> m #foldMap1 :: Semigroup m => (a -> m) -> Lift f a -> m #toNonEmpty :: Lift f a -> NonEmpty a # Foldable1 f => Foldable1 (Rec1 f) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Rec1 f m -> m #foldMap1 :: Semigroup m => (a -> m) -> Rec1 f a -> m #toNonEmpty :: Rec1 f a -> NonEmpty a # Foldable1 f => Foldable1 (Alt f) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Alt f m -> m #foldMap1 :: Semigroup m => (a -> m) -> Alt f a -> m #toNonEmpty :: Alt f a -> NonEmpty a # Bifoldable1 p => Foldable1 (Join p) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Join p m -> m #foldMap1 :: Semigroup m => (a -> m) -> Join p a -> m #toNonEmpty :: Join p a -> NonEmpty a # Foldable1 m => Foldable1 (IdentityT m) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m0 => IdentityT m m0 -> m0 #foldMap1 :: Semigroup m0 => (a -> m0) -> IdentityT m a -> m0 #toNonEmpty :: IdentityT m a -> NonEmpty a # Foldable1 f => Foldable1 (Backwards f) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Backwards f m -> m #foldMap1 :: Semigroup m => (a -> m) -> Backwards f a -> m #toNonEmpty :: Backwards f a -> NonEmpty a # Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Tagged a m -> m #foldMap1 :: Semigroup m => (a0 -> m) -> Tagged a a0 -> m #toNonEmpty :: Tagged a a0 -> NonEmpty a0 # Foldable1 f => Foldable1 (Reverse f) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Reverse f m -> m #foldMap1 :: Semigroup m => (a -> m) -> Reverse f a -> m #toNonEmpty :: Reverse f a -> NonEmpty a # (Foldable1 f, Foldable1 g) => Foldable1 (f :+: g) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => (f :+: g) m -> m #foldMap1 :: Semigroup m => (a -> m) -> (f :+: g) a -> m #toNonEmpty :: (f :+: g) a -> NonEmpty a # (Foldable1 f, Foldable1 g) => Foldable1 (f :*: g) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => (f :*: g) m -> m #foldMap1 :: Semigroup m => (a -> m) -> (f :*: g) a -> m #toNonEmpty :: (f :*: g) a -> NonEmpty a # (Foldable1 f, Foldable1 g) => Foldable1 (Product f g) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Product f g m -> m #foldMap1 :: Semigroup m => (a -> m) -> Product f g a -> m #toNonEmpty :: Product f g a -> NonEmpty a # (Foldable1 f, Foldable1 g) => Foldable1 (Sum f g) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Sum f g m -> m #foldMap1 :: Semigroup m => (a -> m) -> Sum f g a -> m #toNonEmpty :: Sum f g a -> NonEmpty a # Foldable1 f => Foldable1 (M1 i c f) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => M1 i c f m -> m #foldMap1 :: Semigroup m => (a -> m) -> M1 i c f a -> m #toNonEmpty :: M1 i c f a -> NonEmpty a # (Foldable1 f, Foldable1 g) => Foldable1 (f :.: g) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => (f :.: g) m -> m #foldMap1 :: Semigroup m => (a -> m) -> (f :.: g) a -> m #toNonEmpty :: (f :.: g) a -> NonEmpty a # (Foldable1 f, Foldable1 g) => Foldable1 (Compose f g) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Compose f g m -> m #foldMap1 :: Semigroup m => (a -> m) -> Compose f g a -> m #toNonEmpty :: Compose f g a -> NonEmpty a # Foldable1 g => Foldable1 (Joker g a) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Joker g a m -> m #foldMap1 :: Semigroup m => (a0 -> m) -> Joker g a a0 -> m #toNonEmpty :: Joker g a a0 -> NonEmpty a0 # asum1 :: (Foldable1 t, Alt m) => t (m a) -> m a # foldlM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a # Monadic fold over the elements of a non-empty structure, associating to the left, i.e. from left to right. let g = flip$ (=<<) . f
in foldlM1 f (x1 :| [x2, ..., xn]) == (...((x1 f x2) g x2) g...) g xn

foldrM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a #

Monadic fold over the elements of a non-empty structure, associating to the right, i.e. from right to left.

let g = (=<<) . f
in foldrM1 f (x1 :| [x2, ..., xn]) == x1 g (x2 g ... (xn-1 f xn)...)

for1_ :: (Foldable1 t, Apply f) => t a -> (a -> f b) -> f () #

intercalate1 :: (Foldable1 t, Semigroup m) => m -> t m -> m #

Insert an m between each pair of 't m'. Equivalent to intercalateMap1 with id as the second argument.

>>> intercalate1 ", " $"hello" :| ["how", "are", "you"] "hello, how, are, you"  >>> intercalate1 ", "$ "hello" :| []
"hello"

>>> intercalate1 mempty $"I" :| ["Am", "Fine", "You?"] "IAmFineYou?"  intercalateMap1 :: (Foldable1 t, Semigroup m) => m -> (a -> m) -> t a -> m # Insert m between each pair of m derived from a. >>> intercalateMap1 " " show$ True :| [False, True]
"True False True"

>>> intercalateMap1 " " show \$ True :| []
"True"


sequenceA1_ :: (Foldable1 t, Apply f) => t (f a) -> f () #

traverse1_ :: (Foldable1 t, Apply f) => (a -> f b) -> t a -> f () #

# Bifoldable

class Bifoldable (p :: * -> * -> *) where #

Bifoldable identifies foldable structures with two different varieties of elements (as opposed to Foldable, which has one variety of element). Common examples are Either and '(,)':

instance Bifoldable Either where
bifoldMap f _ (Left  a) = f a
bifoldMap _ g (Right b) = g b

instance Bifoldable (,) where
bifoldr f g z (a, b) = f a (g b z)

A minimal Bifoldable definition consists of either bifoldMap or bifoldr. When defining more than this minimal set, one should ensure that the following identities hold:

bifold ≡ bifoldMap id id
bifoldMap f g ≡ bifoldr (mappend . f) (mappend . g) mempty
bifoldr f g z t ≡ appEndo (bifoldMap (Endo . f) (Endo . g) t) z


If the type is also a Bifunctor instance, it should satisfy:

'bifoldMap' f g ≡ 'bifold' . 'bimap' f g

which implies that

'bifoldMap' f g . 'bimap' h i ≡ 'bifoldMap' (f . h) (g . i)

Since: base-4.10.0.0

Minimal complete definition

Methods

bifold :: Monoid m => p m m -> m #

Combines the elements of a structure using a monoid.

bifold ≡ bifoldMap id id

Since: base-4.10.0.0

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> p a b -> m #

Combines the elements of a structure, given ways of mapping them to a common monoid.

bifoldMap f g
≡ bifoldr (mappend . f) (mappend . g) mempty

Since: base-4.10.0.0

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> p a b -> c #

Combines the elements of a structure in a right associative manner. Given a hypothetical function toEitherList :: p a b -> [Either a b] yielding a list of all elements of a structure in order, the following would hold:

bifoldr f g z ≡ foldr (either f g) z . toEitherList`

Since: base-4.10.0.0

Instances
 Since: base-4.10.0.0 Instance detailsDefined in Data.Bifoldable Methodsbifold :: Monoid m => Either m m -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Either a b -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Either a b -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Either a b -> c # Since: base-4.10.0.0 Instance detailsDefined in Data.Bifoldable Methodsbifold :: Monoid m => (m, m) -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> (a, b) -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> (a, b) -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> (a, b) -> c # Since: base-4.10.0.0 Instance detailsDefined in Data.Semigroup Methodsbifold :: Monoid m => Arg m m -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Arg a b -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Arg a b -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Arg a b -> c # Since: base-4.10.0.0 Instance detailsDefined in Data.Bifoldable Methodsbifold :: Monoid m => (x, m, m) -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> (x, a, b) -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> (x, a, b) -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> (x, a, b) -> c # Bifoldable (Const :: * -> * -> *) Since: base-4.10.0.0 Instance detailsDefined in Data.Bifoldable Methodsbifold :: Monoid m => Const m m -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Const a b -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Const a b -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Const a b -> c # Foldable f => Bifoldable (FreeF f) Instance detailsDefined in Control.Monad.Trans.Free Methodsbifold :: Monoid m => FreeF f m m -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> FreeF f a b -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> FreeF f a b -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> FreeF f a b -> c # Foldable f => Bifoldable (CofreeF f) Instance detailsDefined in Control.Comonad.Trans.Cofree Methodsbifold :: Monoid m => CofreeF f m m -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> CofreeF f a b -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> CofreeF f a b -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> CofreeF f a b -> c # Bifoldable (Tagged :: * -> * -> *) Instance detailsDefined in Data.Tagged Methodsbifold :: Monoid m => Tagged m m -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Tagged a b -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Tagged a b -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Tagged a b -> c # Bifoldable (K1 i :: * -> * -> *) Since: base-4.10.0.0 Instance detailsDefined in Data.Bifoldable Methodsbifold :: Monoid m => K1 i m m -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> K1 i a b -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> K1 i a b -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> K1 i a b -> c # Bifoldable ((,,,) x y) Since: base-4.10.0.0 Instance detailsDefined in Data.Bifoldable Methodsbifold :: Monoid m => (x, y, m, m) -> m #bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> (x, y, a, b) -> m #bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> (x, y, a, b) -> c #bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> (x, y, a, b) -> c # Bifoldable ((,,,,) x y z) Since: base-4.10.0.0 Instance detailsDefined in Data.Bifoldable Methodsbifold :: Monoid m => (x, y, z, m, m) -> m #