-
Notifications
You must be signed in to change notification settings - Fork 43
Added monadErrorMaybe
instance
#31
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
Conversation
👍 |
It's not law-abiding though, because of the |
Good point, I didn't think of that. |
Yeah, it is sort of unusual behavior (though I don't see a statement of the laws anywhere). I do find it quite useful though (for combining with functions that return a big :: forall m a. (MonadError String m, Monad m) => Number -> m Number
big n | n < 0 = throwError "Negative"
| n < 2 = throwError "Small"
| otherwise = pure n
bigHead :: [Number] -> Maybe Number
bigHead = big <=< head I guess the alternative is sprinkling something like |
Yeah, the |
I'm happy to merge this if we can change over to |
Done. @paf31 |
Sorry, we need to fix |
Oh yeah. |
Any chance you could rebase this please? |
Done. |
Added `monadErrorMaybe` instance
👍 Thanks! |
If you all think the instance makes sense.