tur/free

stdlib/free.tur
defn

cata

(cata [f fn x] :int)

fold a recursive Fix structure using an algebra.

fthe functor type witness
fnthe algebra function (f a -> a)
xthe Fix f value to fold

Since: Phase HKT-P2

defn

pure-free

(pure-free [x] :int)

lift a pure value into the Free monad.

xthe value to lift

Since: Phase HKT-P2

defn

liftF

(liftF [fa] :int)

lift a single functor action into the Free monad.

faa functor value to lift

Since: Phase HKT-P2

defn

interpret-free

(interpret-free [interp free] :int)

run a Free monad computation with an interpreter.

interpinterpreter function (f a -> m a) as a fat closure
freethe Free monad computation to interpret

Since: Phase HKT-P2