-
Notifications
You must be signed in to change notification settings - Fork 23
Add custom ExceptT (#37) #39
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 custom ExceptT (#37) #39
Conversation
f3d1789 to
08b3164
Compare
|
Do you want to have |
That sounds good but it may be best to finish the Please ping me when this PR is good to review! |
Yes, agree. I wanted to upload this first stub so you can see the direction we're heading. |
My expectation is that |
Oh yes, I believe that as well. I rather meant that I wanted to share this PR here with this one file before I go on working everything out, since it contains the essential motivation for doing all that work. |
|
Sure, sounds good! |
1d0cb53 to
d2e2dc3
Compare
|
I don't know why I didn't mark it as ready for review. I believe it is. |
00b9d3d to
66be5e5
Compare
|
Ah, |
If it's just about |
|
Could you test this transformer somehow? We do have a little testsuite for checking all Selective laws of various instances. |
Yes, I'd replicate the But there is a problem: Where to put the I know two typical solutions to this situation:
I like the second option more. |
|
Ah, we have to add an orphan instance for |
66be5e5 to
dc4c40d
Compare
|
I went for the first option for the time being. Are there any extra laws that make sense checking for |
|
It becomes more cumbersome to derive instances:
Again the question what to do. Some options:
I personally like 1. by far the most. But of course the choice is yours. |
|
@turion Apologies for the long silence! I somehow missed the notifications. While I don't mind dropping compatibility with older GHCs in principle, doing this just to support |
I'm not aware of any. |
Yes, this is fine. Thanks! |
This implementation of ExceptT has an Applicative instance that does not need a Monad constraint of the underlying context.
04519e1 to
bbf7313
Compare
|
Ok, then I think I've done everything :) |
|
The build failure is caused because |
Ah, that's unfortunate. Let's use CPP to match the type for older GHC versions. |
34109d7 to
5211adb
Compare
|
If we already have CPP, shall I re-add |
Sure, let's do that. Thanks! |
1dd68d1 to
fd33e89
Compare
Looks like it may be harder than it seemed. Feel free to skip this bit if you like! |
|
@snowleopard I could figure it out in the end. Ok like this? Then I'll squash. |
|
Awesome, many thanks! I've squashed the commits. I think it's a pretty cool new module :) I'll try to release a new version of the library soon. |
|
Awesome, this was great fun :) |
This reverts commit b883cb4.
|
I just realised (again?) that the |
|
Also, was it really necessary to delete the old transformers instance? It's more restrictive than this one, but still it doesn't do any harm, right? |
|
Agreed with both points! It would be cleaner to reuse a general |
This implementation of ExceptT has an Applicative instance
that does not need a Monad constraint of the underlying context.