Compile your free monad into another language by changing the
suspension functor using the given natural transformation f
.
Compile your free monad into another language by changing the
suspension functor using the given natural transformation f
.
If your natural transformation is effectful, be careful. These
effects will be applied by compile
.
Bind the given continuation to the result of this computation.
Bind the given continuation to the result of this computation. All left-associated binds are reassociated to the right.
Catamorphism.
Catamorphism. Run the first given function if Pure, otherwise, the second given function.
Catamorphism for Free
.
Catamorphism for Free
.
Run to completion, mapping the suspension with the given
transformation at each step and accumulating into the monad M
.
This method uses tailRecM
to provide stack-safety.
Run to completion, using a function that extracts the resumption from its suspension functor.
Evaluate a single layer of the free monad.
Evaluate a single layer of the free monad.
Run to completion, using the given comonad to extract the resumption.
Run to completion, using a function that maps the resumption
from S
to a monad M
.
Run to completion, using monadic recursion to evaluate the
resumption in the context of S
.
Takes one evaluation step in the Free monad, re-associating left-nested binds in the process.
Takes one evaluation step in the Free monad, re-associating left-nested binds in the process.
A free operational monad for some functor
S
. Binding is done using the heap instead of the stack, allowing tail-call elimination.