tur/free
stdlib/free.tur
defn
cata
(cata [f fn x] :int)
fold a recursive Fix structure using an algebra.
Parameters
| f | the functor type witness | |
| fn | the algebra function (f a -> a) | |
| x | the Fix f value to fold |
Since: Phase HKT-P2
defn
pure-free
(pure-free [x] :int)
lift a pure value into the Free monad.
Parameters
| x | the value to lift |
Since: Phase HKT-P2
defn
liftF
(liftF [fa] :int)
lift a single functor action into the Free monad.
Parameters
| fa | a functor value to lift |
Since: Phase HKT-P2
defn
interpret-free
(interpret-free [interp free] :int)
run a Free monad computation with an interpreter.
Parameters
| interp | interpreter function (f a -> m a) as a fat closure | |
| free | the Free monad computation to interpret |
Since: Phase HKT-P2