-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Monad Transformer typeclass #4727
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
Comments
See also |
Definitely not all! You may also be interested in this: https://hackage.haskell.org/package/layers-0.1/docs/Control-Monad-Layer.html This space has been explored quite a bit in the past. Taking a step back, the first two functions in Taking a step further back, what you're scratching at (the difficulty of un-layering a transformer stack once composed) is, IMO, the crux of the problem with monad transformers in general. Their generality means it's impossible to take them apart in the same way you put them together, which is very frustrating and causes a whole series of knock-on problems (see also: CE's Not to appeal to history, but having spent about a decade and a half grappling with this exact frustration, I think in the end the best compromise solution is |
Uh oh!
There was an error while loading. Please reload this page.
I saw this: #4724 and wondered if we have a monad transformer typeclass similar to: https://hackage.haskell.org/package/transformers-0.6.1.2/docs/Control-Monad-Trans-Class.html
I don't see one. I can imagine something like:
And possibly even:
since I think all the transformers seem to have some notion of a "run" version. The laws would be:
The argument against this, I think, would be that it's not clear what useful functions you would write against
MonadTrans
except perhaps for having a clear way to lift:MonadTrans[OptionT].lift(fa)
The text was updated successfully, but these errors were encountered: