You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
attempt::forallmea. MonadErrorem=>ma->m (Eitherea)
attempt a = (Right <$> a) `catchError` (pure <<< Left)
This makes it easier to "not catch more than you need". For example when you want to catch only exceptions thrown by a, and not by b, there is no reasonable way to do this without attempt:
attempt a >>= either e b
-- vs overly defensive
(a >>= b) `catchError` e
The text was updated successfully, but these errors were encountered:
Op 6 apr. 2017 om 17:26 heeft Phil Freeman ***@***.***> het volgende geschreven:
This is the same as try from Control.Monad.Exception so I think we should call this try as well.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
I find this function very useful:
This makes it easier to "not catch more than you need". For example when you want to catch only exceptions thrown by
a
, and not byb
, there is no reasonable way to do this withoutattempt
:The text was updated successfully, but these errors were encountered: