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
eitherToThrow #48
Comments
I usually call this Edit: actually my |
I follow this pattern a lot via |
It explicitly spells out what it's doing, rather than making me think. You can only parse |
I'd like to submit a PR for this if you all are for it. I was looking for something around |
Same here today. https://twitter.com/domenkozar/status/1063147657139503104 @roberth called it escalate: escalate :: (Exception exc, MonadThrow m) => Either exc a -> m a
escalate = escalateAs id
escalateAs :: (Exception exc, MonadThrow m) => (l -> exc) -> Either l a -> m a
escalateAs f = either (throwM . f) pure |
I often look for
is it there already, in more general version?
There is
eitherToError
ineither
, but it's a bit different.The text was updated successfully, but these errors were encountered: