fanout = zip in the Arrow terminology
parallel composition
zip on the right with another fold only for self side-effects
zip with another fold only for its side effects
zip 2 folds to return a pair of values.
zip 2 folds to return a pair of values. alias for zip
alias for observeState
alias for observeNextState
equivalent of the as method for functors, added here for easier type inference
pipe the output of this fold into another fold
contramap the input values
add an effectful action at the end of the fold
first operator on a MonadPlus monad
first-like operator
use a natural transformation to go from context M to context N this can be used to transform a FoldM[A, Id, B] into a FoldM[A, Task, B] for example (a fold with no effects to a fold with monadic effects from the Task monad)
map the output value
flatMap the output value
create a fold that will run this fold repeatedly on input elements and collect all results
alias for <*
observe both the input value and the next state
observe both the input value and the current state
map with another fold
run a FoldM with a FoldableM instance (like a List, an Iterator, a scalaz Process)
run over one element
run a FoldM with a FoldableM instance (like a List, an Iterator, a scalaz Process) and break early if possible
run a FoldM with a FoldableMS instance (like an InputStream which is specialized on producing Array[Byte])
second operator on a MonadPlus monad
second-like operator
add an effectful action at the beginning of the fold
equivalent of the void method for functors, added here for easier type inference
zip 2 folds to return a pair of values.
zip 2 folds to return a pair of values. alias for <*>
A FoldM is a "left fold" over a data structure with:
Both 'start' and 'end' have an effect which allows the whole folding to take place inside a context M.
If 'M' has an 'Apply' instance then FoldM can be made Applicative to allow the folding of two values U and S at the same time.
If 'M' has a 'Monad' instance then FoldM can be made into a 'Compose' instance which allows to compose 2 folds into one, for example:
A FoldM can be used with a 'FoldableM' which produces the elements to fold over. Examples of FoldableM include
Usage example:
sum.run(List(1, 2, 3)) == 6