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
-- Module : Data.Either-- Copyright : (c) The University of Glasgow 2001-- License : BSD-style (see the file libraries/base/LICENSE)--| @since 4.4.0.0instanceMonad (Eithere) whereLeft l >>= _ =Left l
Right r >>= k = k r
In essence, this means that >>= propagates error and does not evaluate k (type: a -> Either e b) unless the Either is a Right (success case)
EDIT: similarly, there's no way to implicitly convert to a different expected result of same error (one would have to do if (!e) { {co_}return e.error(); })
The text was updated successfully, but these errors were encountered:
This functionality is useful, of course, but it'd rather have it in a separate function (other than map()) such that the function that is passed in can always be assumed to return a frg::expected.
Agreed, that's what I meant by "While this behavior is probably fine, it would be desirable to be able to chain expecteds for monadic operations". A sensible name might be then or chain
While this behavior is probably fine, it would be desirable to be able to chain expecteds for monadic operations.
For an example of such see Haskell's
Either
In essence, this means that
>>=
propagates error and does not evaluatek
(type:a -> Either e b
) unless theEither
is aRight
(success case)EDIT: similarly, there's no way to implicitly convert to a different expected result of same error (one would have to do
if (!e) { {co_}return e.error(); }
)The text was updated successfully, but these errors were encountered: