:: a -> Maybe b -> Either a b package:from-sum

Convert a Maybe to an Either. If the Maybe is Just, then return the value in Right.
>>> maybeToEither 3 $ Just "hello"
Right "hello"
If the Maybe is Nothing, then use the given e as Left.
>>> maybeToEither 3 Nothing
Left 3
A fliped version of maybeToEither.
>>> maybeToEitherOr (Just "hello") 3
Right "hello"
>>> maybeToEitherOr Nothing 3
Left 3