|
Data.Either.Utils | Portability | portable | Stability | provisional | Maintainer | John Goerzen <jgoerzen@complete.org> |
|
|
|
Description |
Utilities for working with the Either data type
Copyright (c) 2004 John Goerzen, jgoerzen@complete.org
|
|
Synopsis |
|
|
|
Documentation |
|
|
:: MonadError e m | | => e | (Right a) will be returned if this is (Just a)
| -> Maybe a | | -> m a | | Converts a Maybe value to an Either value, using the supplied parameter
as the Left value if the Maybe is Nothing.
This function can be interpreted as:
maybeToEither :: e -> Maybe a -> Either e a Its definition is given as it is so that it can be used in the Error and related monads.
|
|
|
|
Pulls a Right value out of an Either value. If the Either value is
Left, raises an exception with error.
|
|
|
Like forceEither, but can raise a specific message with the error.
|
|
|
Takes an either and transforms it into something of the more generic
MonadError class.
|
|
|
Take a Left to a value, crashes on a Right
|
|
|
Take a Right to a value, crashes on a Left
|
|
|
Take an Either, and return the value inside it
|
|
Produced by Haddock version 2.6.0 |