fused-effects-1.1.2.2: A fast, flexible, fused effect system.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Carrier.Throw.Either

Description

A carrier for a Throw effect.

Since: 1.0.0.0

Synopsis

Throw carrier

runThrow :: ThrowC e m a -> m (Either e a) Source #

Run a Throw effect, returning failures in Left and successful computations’ results in Right.

newtype ThrowC e m a Source #

Since: 1.0.0.0

Constructors

ThrowC (ErrorC e m a) 

Instances

Instances details
MonadTrans (ThrowC e) Source # 
Instance details

Defined in Control.Carrier.Throw.Either

Methods

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

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

Defined in Control.Carrier.Throw.Either

Methods

fail :: String -> ThrowC e m a #

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

Defined in Control.Carrier.Throw.Either

Methods

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

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

Defined in Control.Carrier.Throw.Either

Methods

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

(Alternative m, Monad m) => Alternative (ThrowC e m) Source # 
Instance details

Defined in Control.Carrier.Throw.Either

Methods

empty :: ThrowC e m a #

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

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

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

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

Defined in Control.Carrier.Throw.Either

Methods

pure :: a -> ThrowC e m a #

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

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

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

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

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

Defined in Control.Carrier.Throw.Either

Methods

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

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

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

Defined in Control.Carrier.Throw.Either

Methods

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

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

return :: a -> ThrowC e m a #

(Alternative m, Monad m) => MonadPlus (ThrowC e m) Source # 
Instance details

Defined in Control.Carrier.Throw.Either

Methods

mzero :: ThrowC e m a #

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

Algebra sig m => Algebra (Throw e :+: sig) (ThrowC e m) Source # 
Instance details

Defined in Control.Carrier.Throw.Either

Methods

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

Throw effect