xml-extractors-0.2.1.0: Simple wrapper over xml to extract data from parsed xml

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.XML.Light.Extractors.Internal.Result

Synopsis

Documentation

data Result e a Source

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.

Constructors

Fatal e 
Fail e 
Ok a 

Instances

Error e => Alternative (Result e) 
Monad (Result e) 
Functor (Result e) 
Applicative (Result e) 
(Show e, Show a) => Show (Result e a) 

toEither :: Result a b -> Either a b Source

Maps Fail and Fatal to Left.

escalate :: Result e a -> Result e a Source

Maps Fail to Fatal.

data ResultT e m a Source

Instances

Error e => MonadTrans (ResultT e) 
(Functor m, Monad m, Error e) => Alternative (ResultT e m) 
(Monad m, Error e) => Monad (ResultT e m) 
Functor m => Functor (ResultT e m) 
(Error e, Monad m) => MonadPlus (ResultT e m) 
(Functor m, Monad m) => Applicative (ResultT e m) 

runResultT :: ResultT e m a -> m (Result e a) Source

throwError :: (Error e, Monad m) => e -> ResultT e m a Source

throwFatal :: (Error e, Monad m) => e -> ResultT e m a Source

mapResult :: (Functor m, Monad m) => (Result e1 a1 -> Result e a) -> ResultT e1 m a1 -> ResultT e m a Source

lift :: MonadTrans t => forall m a. Monad m => m a -> t m a

Lift a computation from the argument monad to the constructed monad.