Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Result e a
- toEither :: Result a b -> Either a b
- escalate :: Result e a -> Result e a
- data ResultT e m a
- runResultT :: ResultT e m a -> m (Result e a)
- throwError :: (Error e, Monad m) => e -> ResultT e m a
- throwFatal :: (Error e, Monad m) => e -> ResultT e m a
- mapResult :: (Functor m, Monad m) => (Result e1 a1 -> Result e a) -> ResultT e1 m a1 -> ResultT e m a
- class Error a where
- lift :: (MonadTrans t, Monad m) => m a -> t m a
Documentation
Result
is like Either
but with two error states, Fail
and Fatal
.
Fail
is precisely analogous to Left
while Fatal
has short cut
semantics for Alternative
.
The idea is that Fatal
errors cannot be circumvented by <|>
etc.
Instances
Error e => MonadTrans (ResultT e) Source # | |
Defined in Text.XML.Light.Extractors.Internal.Result | |
(Monad m, Error e) => Monad (ResultT e m) Source # | |
Functor m => Functor (ResultT e m) Source # | |
(Monad m, Error e) => MonadFail (ResultT e m) Source # | |
Defined in Text.XML.Light.Extractors.Internal.Result | |
(Functor m, Monad m) => Applicative (ResultT e m) Source # | |
Defined in Text.XML.Light.Extractors.Internal.Result | |
(Functor m, Monad m, Error e) => Alternative (ResultT e m) Source # | |
(Error e, Monad m) => MonadPlus (ResultT e m) Source # | |
runResultT :: ResultT e m a -> m (Result e a) Source #
mapResult :: (Functor m, Monad m) => (Result e1 a1 -> Result e a) -> ResultT e1 m a1 -> ResultT e m a Source #
Nothing
Creates an exception without a message.
The default implementation is
.strMsg
""
Instances
Error IOException | |
Defined in Control.Monad.Trans.Error noMsg :: IOException # strMsg :: String -> IOException # | |
Error ExtractionErr Source # | |
Defined in Text.XML.Light.Extractors.Internal noMsg :: ExtractionErr # strMsg :: String -> ExtractionErr # | |
ErrorList a => Error [a] | A string can be thrown as an error. |
lift :: (MonadTrans t, Monad m) => m a -> t m a #
Lift a computation from the argument monad to the constructed monad.