-
Notifications
You must be signed in to change notification settings - Fork 43
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
Proposal:Split MonadReader and MonadWriter #63
Comments
👍 |
👍 But I have a (slightly tangential) question about this actually. Recently I had a case where I needed to use |
The monad transformer classes don't define the layering semantics. You can One way to get an explicit layering is to work parametrically in whichever On Thu, Nov 19, 2015 at 2:12 PM, Phil Freeman [email protected]
|
Right, I do this in the typechecker when I know I want to just put I suppose in the case where I really do want to be parametric in both, I could just define my own custom subclass and document its laws. |
That is pretty much what I'd do. On Thu, Nov 19, 2015 at 4:15 PM, Phil Freeman [email protected]
|
In
mtl
I've long wanted to split apartMonadReader
andMonadWriter
into two parts each. Splitting off the algebraic effects in each case yields a subclass that is much more often implementable.Of course the fundeps there can't be written currently.
This has the benefit that a number of additional instances can exist for MonadAsk and MonadTell.
Notably you can use MonadTell for things like logging in some IO-like monad. Or with something like
reflection
you can make:The text was updated successfully, but these errors were encountered: