Comonad instance for Fold
Apply instance
Apply instance
This means that we can write:
val mean: Fold[Int, Int] = (sum |@| count)(_ / _)
An Apply instance is also a Functor instance so we can write:
val meanTimes2 = mean.map(_ * 2)
A FoldM can be turned into a Category if M has a MonadPlus instance
Cobind instance
A FoldM can be turned into a Compose if M has a Monad instance
A FoldM can be turned into a Compose if M has a Monad instance
This allows us to write:
val scans = sum compose list
Profunctor instance
Profunctor instance
This is especially useful because we can "map" on the input element
val doubleSum = fromMonoid[Double] // sum all elements val roundedDoubleSum = doubleSum.mapfst(_.round)
Natural transformation from Id to IO
Natural transformation from a List to an Iterator
monoid to append sinks effects
a fold from arguments of a fold left
a fold from a Monoid
a fold which uses a Monoid to accumulate elements
a fold from a Reducer
a fold with just a start action
a fold for the evaluation of a State object
a fold for the execution of a State object
a fold from running a State object
identity fold for a MonadPlus monad
sink doing nothing
Typeclass instances and creation methods for folds