fused-effects-1.1.0.0: A fast, flexible, fused effect system.
Safe HaskellNone
LanguageHaskell2010

Control.Carrier.Error.Either

Description

A carrier for an Error effect.

Since: 1.0.0.0

Synopsis

Error carrier

runError :: ErrorC exc m a -> m (Either exc a) Source #

Run an Error effect, returning uncaught errors in Left and successful computations’ values in Right.

runError (pure a) = pure (Right a)
runError (throwError e) = pure (Left e)
runError (throwError e `catchError` pure) = pure (Right e)

Since: 0.1.0.0

newtype ErrorC e m a Source #

Since: 0.1.0.0

Constructors

ErrorC (ExceptT e m a) 

Instances

Instances details
MonadTrans (ErrorC e) Source # 
Instance details

Defined in Control.Carrier.Error.Either

Methods

lift :: Monad m => m a -> ErrorC e m a #

Monad m => Monad (ErrorC e m) Source # 
Instance details

Defined in Control.Carrier.Error.Either

Methods

(>>=) :: ErrorC e m a -> (a -> ErrorC e m b) -> ErrorC e m b #

(>>) :: ErrorC e m a -> ErrorC e m b -> ErrorC e m b #

return :: a -> ErrorC e m a #

Functor m => Functor (ErrorC e m) Source # 
Instance details

Defined in Control.Carrier.Error.Either

Methods

fmap :: (a -> b) -> ErrorC e m a -> ErrorC e m b #

(<$) :: a -> ErrorC e m b -> ErrorC e m a #

MonadFix m => MonadFix (ErrorC e m) Source # 
Instance details

Defined in Control.Carrier.Error.Either

Methods

mfix :: (a -> ErrorC e m a) -> ErrorC e m a #

MonadFail m => MonadFail (ErrorC e m) Source # 
Instance details

Defined in Control.Carrier.Error.Either

Methods

fail :: String -> ErrorC e m a #

Monad m => Applicative (ErrorC e m) Source # 
Instance details

Defined in Control.Carrier.Error.Either

Methods

pure :: a -> ErrorC e m a #

(<*>) :: ErrorC e m (a -> b) -> ErrorC e m a -> ErrorC e m b #

liftA2 :: (a -> b -> c) -> ErrorC e m a -> ErrorC e m b -> ErrorC e m c #

(*>) :: ErrorC e m a -> ErrorC e m b -> ErrorC e m b #

(<*) :: ErrorC e m a -> ErrorC e m b -> ErrorC e m a #

MonadIO m => MonadIO (ErrorC e m) Source # 
Instance details

Defined in Control.Carrier.Error.Either

Methods

liftIO :: IO a -> ErrorC e m a #

(Alternative m, Monad m) => Alternative (ErrorC e m) Source #

ErrorC passes Alternative operations along to the underlying monad m, rather than combining errors à la ExceptT.

Instance details

Defined in Control.Carrier.Error.Either

Methods

empty :: ErrorC e m a #

(<|>) :: ErrorC e m a -> ErrorC e m a -> ErrorC e m a #

some :: ErrorC e m a -> ErrorC e m [a] #

many :: ErrorC e m a -> ErrorC e m [a] #

(Alternative m, Monad m) => MonadPlus (ErrorC e m) Source #

ErrorC passes MonadPlus operations along to the underlying monad m, rather than combining errors à la ExceptT.

Instance details

Defined in Control.Carrier.Error.Either

Methods

mzero :: ErrorC e m a #

mplus :: ErrorC e m a -> ErrorC e m a -> ErrorC e m a #

Algebra sig m => Algebra (Error e :+: sig) (ErrorC e m) Source # 
Instance details

Defined in Control.Carrier.Error.Either

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (ErrorC e m) -> (Error e :+: sig) n a -> ctx () -> ErrorC e m (ctx a) Source #

Error effect