-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add retractT #61
Comments
It is currently possible to define retractT :: (Functor (t m), Monad (t m), MonadTrans t, Monad m) =>
FreeT (t m) m a -> t m a
retractT = iterTM join Would you like this implementation? |
That looks right. |
Hm. There appears to be also a different version: retractM :: (Functor m, Monad m) => FreeT m m a -> m a
retractM = iterT join With that retractT = retractM . hoistFreeT lift Alternatively retractM = runIdentityT . retractT . transFreeT IdentityT Though I think Would you like both |
I'd check to see which matches the semantics of
|
Oh wow, I didn't even realize there was an |
Having both a more general function and the example of fold code would be great. Perhaps the current |
Alright, that sounds good. I can include the current implementation as a comment alongside the |
Added in patch b75fbf5 |
Pipes.Group
haswhich could generalize to
Alternately we might work with a monad homomorphism instead.
The text was updated successfully, but these errors were encountered: