Safe Haskell | None |
---|

- class MFoldable t where
- type Elem t :: *
- foldMap :: Monoid m => (Elem t -> m) -> t -> m
- foldl :: (a -> Elem t -> a) -> a -> t -> a
- foldl' :: (a -> Elem t -> a) -> a -> t -> a
- foldl1 :: (Elem t -> Elem t -> Elem t) -> t -> Elem t
- foldr :: (Elem t -> b -> b) -> b -> t -> b
- foldr' :: (Elem t -> b -> b) -> b -> t -> b
- foldr1 :: (Elem t -> Elem t -> Elem t) -> t -> Elem t
- foldM :: (Monad m, MFoldable t) => (a -> Elem t -> m a) -> a -> t -> m a
- mapM_ :: (MFoldable t, Monad m) => (Elem t -> m b) -> t -> m ()

# Documentation

foldMap :: Monoid m => (Elem t -> m) -> t -> mSource

Map each element to a monoid and combine the results

foldl :: (a -> Elem t -> a) -> a -> t -> aSource

Left-associative fold

foldl' :: (a -> Elem t -> a) -> a -> t -> aSource

Strict version of `foldl`

.

foldl1 :: (Elem t -> Elem t -> Elem t) -> t -> Elem tSource

A variant of `foldl`

with no base case. Requires at least 1
list element.

foldr :: (Elem t -> b -> b) -> b -> t -> bSource

Right-associative fold

foldr' :: (Elem t -> b -> b) -> b -> t -> bSource

Strict version of `foldr`

foldr1 :: (Elem t -> Elem t -> Elem t) -> t -> Elem tSource

Like `foldr`

, but with no starting value

foldM :: (Monad m, MFoldable t) => (a -> Elem t -> m a) -> a -> t -> m aSource

Monadic left fold

mapM_ :: (MFoldable t, Monad m) => (Elem t -> m b) -> t -> m ()Source

Monadic map, discarding results