-
Notifications
You must be signed in to change notification settings - Fork 64
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
Bypass Coercible Type for Deriving Monad* Classes of New Transformers Composed of Transformers #149
base: master
Are you sure you want to change the base?
Conversation
(Earlier message was a mistake; sorry for noise.) Is this basically the same concept as |
I appreciate the established convention you pointed out. So, for the case above propose to create |
The reason we don't have |
@kozross Where do I find what is in your support window? |
I have implemented a partial example for LiftingReader. Can you check if this is what you are looking for? |
Is there anything else that needs to be discussed before I finish this up for MonadReader, MonadWriter, and MonadState? |
I have tried a different approach for |
@rhendric Could you review the changes since your last review? |
I see no glaring issues. |
@kozross Could you check if this is ready to pull? |
When creating a new transformer it is often composed of other transformers. The transformers that it is composed of usually have specific purposes that are unrelated to the more general uses of the Monad* classes and typically you still want to define the Monad* instances for the underlying monad.
My real world use case is the
where I still want to have MonadReader but not for reading Handle but rather the r for m
instance MonadReader r m => MonadReader r (FileT w m)
This is a bit annoying for this case but even more so for transformers wrapping RWS. In just the ReaderT case the following must be defined
DerivingVia seems to be a better option for this by using
Bypass
There could probably a more succinct way to write the derivation but this is what I have so far.