You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code also adds analogues of these recursion schemes for the existing FreeT class. The isomorphism of FreeT and FT is witnessed by the functions toFreeT and fromFreeT.
If the cataFT and cataFreeT definitions can be moved to a type class for free monad transformers (the transformer version of MonadFree), the recursion schemes can be written generically. I'm not sure if this is a good design choice.
There are some more functions in the control-monad-free package not yet included in free. I think it would be worth porting over those that are likely to be useful.
(Note: This code is a first draft. There are only the bare minimum of type class instances, no documentation, and not very good names for the new types and functions.)
The text was updated successfully, but these errors were encountered:
Code here
This is a first attempt at a Church-encoded free monad transformer, represented by the type:
The module includes equivalents of
hoistFreeT
andtransFreeT
fromControl.Monad.Trans.Free
.There are also three recursion schemes:
The code also adds analogues of these recursion schemes for the existing
FreeT
class. The isomorphism ofFreeT
andFT
is witnessed by the functionstoFreeT
andfromFreeT
.If the
cataFT
andcataFreeT
definitions can be moved to a type class for free monad transformers (the transformer version ofMonadFree
), the recursion schemes can be written generically. I'm not sure if this is a good design choice.There are some more functions in the control-monad-free package not yet included in
free
. I think it would be worth porting over those that are likely to be useful.(Note: This code is a first draft. There are only the bare minimum of type class instances, no documentation, and not very good names for the new types and functions.)
The text was updated successfully, but these errors were encountered: