folds-0.6.2: Beautiful Folding

Safe HaskellTrustworthy

Data.Fold.M

Description

Unlike L and R this Comonad is based on a (->) r Comonad for a Monoid r rather than than on the Store r Comonad.

Synopsis

Documentation

data M a b Source

A foldMap caught in amber. a.k.a. a monoidal reducer

Constructors

forall m . M (m -> b) (a -> m) (m -> m -> m) m 

Instances

Profunctor M 
Choice M 
Folding M

efficient prefix, efficient postfix

Scan M 
AsRM M

We can convert from a monoidal fold to a lazy right fold

AsRM1 M 
Monad (M a) 
Functor (M a) 
Applicative (M a) 
MonadZip (M a) 
Comonad (M a) 
ComonadApply (M a) 
Apply (M a) 
Bind (M a) 
Extend (M a)