fused-effects-0.3.0.0: A fast, flexible, fused effect system.

Safe HaskellNone
LanguageHaskell2010

Control.Effect

Synopsis

Documentation

class (HFunctor sig, Monad m) => Carrier sig m | m -> sig Source #

The class of carriers (results) for algebras (effect handlers) over signatures (effects), whose actions are given by the eff method.

Minimal complete definition

eff

Instances
Carrier Pure PureC Source # 
Instance details

Defined in Control.Effect.Pure

Methods

eff :: Pure PureC (PureC a) -> PureC a Source #

ret :: a -> PureC a Source #

Monad m => Carrier (Lift m) (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

eff :: Lift m (LiftC m) (LiftC m a) -> LiftC m a Source #

ret :: a -> LiftC m a Source #

(Carrier sig m, MonadIO m) => Carrier (Resource :+: sig) (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

eff :: (Resource :+: sig) (ResourceC m) (ResourceC m a) -> ResourceC m a Source #

ret :: a -> ResourceC m a Source #

(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

eff :: (NonDet :+: sig) (NonDetC m) (NonDetC m a) -> NonDetC m a Source #

ret :: a -> NonDetC m a Source #

(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

eff :: (NonDet :+: sig) (OnceC m) (OnceC m a) -> OnceC m a Source #

ret :: a -> OnceC m a Source #

(Carrier sig m, Effect sig) => Carrier (Fresh :+: sig) (FreshC m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

eff :: (Fresh :+: sig) (FreshC m) (FreshC m a) -> FreshC m a Source #

ret :: a -> FreshC m a Source #

(Carrier sig m, Effect sig) => Carrier (Fail :+: sig) (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

eff :: (Fail :+: sig) (FailC m) (FailC m a) -> FailC m a Source #

ret :: a -> FailC m a Source #

(Carrier sig m, Effect sig) => Carrier (Cut :+: (NonDet :+: sig)) (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

eff :: (Cut :+: (NonDet :+: sig)) (CutC m) (CutC m a) -> CutC m a Source #

ret :: a -> CutC m a Source #

(Carrier sig m, Effect sig) => Carrier (Cull :+: (NonDet :+: sig)) (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

eff :: (Cull :+: (NonDet :+: sig)) (CullC m) (CullC m a) -> CullC m a Source #

ret :: a -> CullC m a Source #

(Carrier sig m, Effect sig) => Carrier (Trace :+: sig) (TraceByReturningC m) Source # 
Instance details

Defined in Control.Effect.Trace

Carrier sig m => Carrier (Trace :+: sig) (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

(MonadIO m, Carrier sig m) => Carrier (Trace :+: sig) (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

eff :: (State s :+: sig) (StateC s m) (StateC s m a) -> StateC s m a Source #

ret :: a -> StateC s m a Source #

(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Lazy

Methods

eff :: (State s :+: sig) (StateC s m) (StateC s m a) -> StateC s m a Source #

ret :: a -> StateC s m a Source #

Carrier sig m => Carrier (Reader r :+: sig) (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

eff :: (Reader r :+: sig) (ReaderC r m) (ReaderC r m a) -> ReaderC r m a Source #

ret :: a -> ReaderC r m a Source #

(Carrier sig m, Effect sig, RandomGen g) => Carrier (Random :+: sig) (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

eff :: (Random :+: sig) (RandomC g m) (RandomC g m a) -> RandomC g m a Source #

ret :: a -> RandomC g m a Source #

(Carrier sig m, Effect sig) => Carrier (Error e :+: sig) (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Error

Methods

eff :: (Error e :+: sig) (ErrorC e m) (ErrorC e m a) -> ErrorC e m a Source #

ret :: a -> ErrorC e m a Source #

Carrier sig m => Carrier (Resumable err :+: sig) (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

eff :: (Resumable err :+: sig) (ResumableWithC err m) (ResumableWithC err m a) -> ResumableWithC err m a Source #

ret :: a -> ResumableWithC err m a Source #

(Carrier sig m, Effect sig) => Carrier (Resumable err :+: sig) (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

eff :: (Resumable err :+: sig) (ResumableC err m) (ResumableC err m a) -> ResumableC err m a Source #

ret :: a -> ResumableC err m a Source #

(Monoid w, Carrier sig m, Effect sig) => Carrier (Writer w :+: sig) (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

eff :: (Writer w :+: sig) (WriterC w m) (WriterC w m a) -> WriterC w m a Source #

ret :: a -> WriterC w m a Source #

class HFunctor sig => Effect sig Source #

The class of effect types, which must:

  1. Be functorial in their last two arguments, and
  2. Support threading effects in higher-order positions through using the carrier’s suspended state.

Minimal complete definition

handle

Instances
Effect Pure Source # 
Instance details

Defined in Control.Effect.Pure

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Pure m (m a) -> Pure n (n (f a)) Source #

Effect Resource Source # 
Instance details

Defined in Control.Effect.Resource

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Resource m (m a) -> Resource n (n (f a)) Source #

Effect Random Source # 
Instance details

Defined in Control.Effect.Random

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Random m (m a) -> Random n (n (f a)) Source #

Effect NonDet Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> NonDet m (m a) -> NonDet n (n (f a)) Source #

Effect Fresh Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Fresh m (m a) -> Fresh n (n (f a)) Source #

Effect Fail Source # 
Instance details

Defined in Control.Effect.Fail

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Fail m (m a) -> Fail n (n (f a)) Source #

Effect Cut Source # 
Instance details

Defined in Control.Effect.Cut

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Cut m (m a) -> Cut n (n (f a)) Source #

Effect Cull Source # 
Instance details

Defined in Control.Effect.Cull

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Cull m (m a) -> Cull n (n (f a)) Source #

Effect Trace Source # 
Instance details

Defined in Control.Effect.Trace

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Trace m (m a) -> Trace n (n (f a)) Source #

Effect (State s) Source # 
Instance details

Defined in Control.Effect.State.Internal

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> State s m (m a) -> State s n (n (f a)) Source #

Effect (Reader r) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Reader r m (m a) -> Reader r n (n (f a)) Source #

Functor sig => Effect (Lift sig) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Lift sig m (m a) -> Lift sig n (n (f a)) Source #

Effect (Error exc) Source # 
Instance details

Defined in Control.Effect.Error

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Error exc m (m a) -> Error exc n (n (f a)) Source #

Effect (Resumable err) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Resumable err m (m a) -> Resumable err n (n (f a)) Source #

Effect (Writer w) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Writer w m (m a) -> Writer w n (n (f a)) Source #

(Effect l, Effect r) => Effect (l :+: r) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> (l :+: r) m (m a) -> (l :+: r) n (n (f a)) Source #

data PureC a Source #

Instances
Monad PureC Source # 
Instance details

Defined in Control.Effect.Pure

Methods

(>>=) :: PureC a -> (a -> PureC b) -> PureC b #

(>>) :: PureC a -> PureC b -> PureC b #

return :: a -> PureC a #

fail :: String -> PureC a #

Functor PureC Source # 
Instance details

Defined in Control.Effect.Pure

Methods

fmap :: (a -> b) -> PureC a -> PureC b #

(<$) :: a -> PureC b -> PureC a #

Applicative PureC Source # 
Instance details

Defined in Control.Effect.Pure

Methods

pure :: a -> PureC a #

(<*>) :: PureC (a -> b) -> PureC a -> PureC b #

liftA2 :: (a -> b -> c) -> PureC a -> PureC b -> PureC c #

(*>) :: PureC a -> PureC b -> PureC b #

(<*) :: PureC a -> PureC b -> PureC a #

Carrier Pure PureC Source # 
Instance details

Defined in Control.Effect.Pure

Methods

eff :: Pure PureC (PureC a) -> PureC a Source #

ret :: a -> PureC a Source #

data Pure (m :: * -> *) k Source #

Instances
Effect Pure Source # 
Instance details

Defined in Control.Effect.Pure

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Pure m (m a) -> Pure n (n (f a)) Source #

HFunctor Pure Source # 
Instance details

Defined in Control.Effect.Pure

Methods

fmap' :: (a -> b) -> Pure m a -> Pure m b Source #

hmap :: (forall x. m x -> n x) -> Pure m a -> Pure n a Source #

Carrier Pure PureC Source # 
Instance details

Defined in Control.Effect.Pure

Methods

eff :: Pure PureC (PureC a) -> PureC a Source #

ret :: a -> PureC a Source #

Functor (Pure m) Source # 
Instance details

Defined in Control.Effect.Pure

Methods

fmap :: (a -> b) -> Pure m a -> Pure m b #

(<$) :: a -> Pure m b -> Pure m a #

run :: PureC a -> a Source #

Run an action exhausted of effects to produce its final result value.

class Member (sub :: (* -> *) -> * -> *) sup Source #

Minimal complete definition

inj, prj

Instances
Member sub sub Source # 
Instance details

Defined in Control.Effect.Sum

Methods

inj :: sub m a -> sub m a Source #

prj :: sub m a -> Maybe (sub m a) Source #

Member sub sup => Member sub (sub' :+: sup) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

inj :: sub m a -> (sub' :+: sup) m a Source #

prj :: (sub' :+: sup) m a -> Maybe (sub m a) Source #

Member sub (sub :+: sup) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

inj :: sub m a -> (sub :+: sup) m a Source #

prj :: (sub :+: sup) m a -> Maybe (sub m a) Source #

data (f :+: g) (m :: * -> *) k infixr 4 Source #

Instances
Member sub sup => Member sub (sub' :+: sup) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

inj :: sub m a -> (sub' :+: sup) m a Source #

prj :: (sub' :+: sup) m a -> Maybe (sub m a) Source #

Member sub (sub :+: sup) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

inj :: sub m a -> (sub :+: sup) m a Source #

prj :: (sub :+: sup) m a -> Maybe (sub m a) Source #

(Effect l, Effect r) => Effect (l :+: r) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> (l :+: r) m (m a) -> (l :+: r) n (n (f a)) Source #

(HFunctor l, HFunctor r) => HFunctor (l :+: r) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

fmap' :: (a -> b) -> (l :+: r) m a -> (l :+: r) m b Source #

hmap :: (forall x. m x -> n x) -> (l :+: r) m a -> (l :+: r) n a Source #

(Carrier sig m, MonadIO m) => Carrier (Resource :+: sig) (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

eff :: (Resource :+: sig) (ResourceC m) (ResourceC m a) -> ResourceC m a Source #

ret :: a -> ResourceC m a Source #

(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

eff :: (NonDet :+: sig) (NonDetC m) (NonDetC m a) -> NonDetC m a Source #

ret :: a -> NonDetC m a Source #

(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

eff :: (NonDet :+: sig) (OnceC m) (OnceC m a) -> OnceC m a Source #

ret :: a -> OnceC m a Source #

(Carrier sig m, Effect sig) => Carrier (Fresh :+: sig) (FreshC m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

eff :: (Fresh :+: sig) (FreshC m) (FreshC m a) -> FreshC m a Source #

ret :: a -> FreshC m a Source #

(Carrier sig m, Effect sig) => Carrier (Fail :+: sig) (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

eff :: (Fail :+: sig) (FailC m) (FailC m a) -> FailC m a Source #

ret :: a -> FailC m a Source #

(Carrier sig m, Effect sig) => Carrier (Cut :+: (NonDet :+: sig)) (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

eff :: (Cut :+: (NonDet :+: sig)) (CutC m) (CutC m a) -> CutC m a Source #

ret :: a -> CutC m a Source #

(Carrier sig m, Effect sig) => Carrier (Cull :+: (NonDet :+: sig)) (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

eff :: (Cull :+: (NonDet :+: sig)) (CullC m) (CullC m a) -> CullC m a Source #

ret :: a -> CullC m a Source #

(Carrier sig m, Effect sig) => Carrier (Trace :+: sig) (TraceByReturningC m) Source # 
Instance details

Defined in Control.Effect.Trace

Carrier sig m => Carrier (Trace :+: sig) (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

(MonadIO m, Carrier sig m) => Carrier (Trace :+: sig) (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

eff :: (State s :+: sig) (StateC s m) (StateC s m a) -> StateC s m a Source #

ret :: a -> StateC s m a Source #

(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Lazy

Methods

eff :: (State s :+: sig) (StateC s m) (StateC s m a) -> StateC s m a Source #

ret :: a -> StateC s m a Source #

Carrier sig m => Carrier (Reader r :+: sig) (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

eff :: (Reader r :+: sig) (ReaderC r m) (ReaderC r m a) -> ReaderC r m a Source #

ret :: a -> ReaderC r m a Source #

(Carrier sig m, Effect sig, RandomGen g) => Carrier (Random :+: sig) (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

eff :: (Random :+: sig) (RandomC g m) (RandomC g m a) -> RandomC g m a Source #

ret :: a -> RandomC g m a Source #

(Carrier sig m, Effect sig) => Carrier (Error e :+: sig) (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Error

Methods

eff :: (Error e :+: sig) (ErrorC e m) (ErrorC e m a) -> ErrorC e m a Source #

ret :: a -> ErrorC e m a Source #

Carrier sig m => Carrier (Resumable err :+: sig) (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

eff :: (Resumable err :+: sig) (ResumableWithC err m) (ResumableWithC err m a) -> ResumableWithC err m a Source #

ret :: a -> ResumableWithC err m a Source #

(Carrier sig m, Effect sig) => Carrier (Resumable err :+: sig) (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

eff :: (Resumable err :+: sig) (ResumableC err m) (ResumableC err m a) -> ResumableC err m a Source #

ret :: a -> ResumableC err m a Source #

(Monoid w, Carrier sig m, Effect sig) => Carrier (Writer w :+: sig) (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

eff :: (Writer w :+: sig) (WriterC w m) (WriterC w m a) -> WriterC w m a Source #

ret :: a -> WriterC w m a Source #

(Functor (f m), Functor (g m)) => Functor ((f :+: g) m) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

fmap :: (a -> b) -> (f :+: g) m a -> (f :+: g) m b #

(<$) :: a -> (f :+: g) m b -> (f :+: g) m a #

(Eq (f m k), Eq (g m k)) => Eq ((f :+: g) m k) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

(==) :: (f :+: g) m k -> (f :+: g) m k -> Bool #

(/=) :: (f :+: g) m k -> (f :+: g) m k -> Bool #

(Ord (f m k), Ord (g m k)) => Ord ((f :+: g) m k) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

compare :: (f :+: g) m k -> (f :+: g) m k -> Ordering #

(<) :: (f :+: g) m k -> (f :+: g) m k -> Bool #

(<=) :: (f :+: g) m k -> (f :+: g) m k -> Bool #

(>) :: (f :+: g) m k -> (f :+: g) m k -> Bool #

(>=) :: (f :+: g) m k -> (f :+: g) m k -> Bool #

max :: (f :+: g) m k -> (f :+: g) m k -> (f :+: g) m k #

min :: (f :+: g) m k -> (f :+: g) m k -> (f :+: g) m k #

(Show (f m k), Show (g m k)) => Show ((f :+: g) m k) Source # 
Instance details

Defined in Control.Effect.Sum

Methods

showsPrec :: Int -> (f :+: g) m k -> ShowS #

show :: (f :+: g) m k -> String #

showList :: [(f :+: g) m k] -> ShowS #

send :: (Member effect sig, Carrier sig m) => effect m (m a) -> m a Source #

Construct a request for an effect to be interpreted by some handler later on.

data State s (m :: * -> *) k Source #

Instances
Effect (State s) Source # 
Instance details

Defined in Control.Effect.State.Internal

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> State s m (m a) -> State s n (n (f a)) Source #

HFunctor (State s) Source # 
Instance details

Defined in Control.Effect.State.Internal

Methods

fmap' :: (a -> b) -> State s m a -> State s m b Source #

hmap :: (forall x. m x -> n x) -> State s m a -> State s n a Source #

Functor (State s m) Source # 
Instance details

Defined in Control.Effect.State.Internal

Methods

fmap :: (a -> b) -> State s m a -> State s m b #

(<$) :: a -> State s m b -> State s m a #

(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

eff :: (State s :+: sig) (StateC s m) (StateC s m a) -> StateC s m a Source #

ret :: a -> StateC s m a Source #

(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Lazy

Methods

eff :: (State s :+: sig) (StateC s m) (StateC s m a) -> StateC s m a Source #

ret :: a -> StateC s m a Source #

data StateC s m a Source #

Instances
MonadTrans (StateC s) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

lift :: Monad m => m a -> StateC s m a #

Monad m => Monad (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

(>>=) :: StateC s m a -> (a -> StateC s m b) -> StateC s m b #

(>>) :: StateC s m a -> StateC s m b -> StateC s m b #

return :: a -> StateC s m a #

fail :: String -> StateC s m a #

Functor m => Functor (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

fmap :: (a -> b) -> StateC s m a -> StateC s m b #

(<$) :: a -> StateC s m b -> StateC s m a #

MonadFail m => MonadFail (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

fail :: String -> StateC s m a #

Monad m => Applicative (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

pure :: a -> StateC s m a #

(<*>) :: StateC s m (a -> b) -> StateC s m a -> StateC s m b #

liftA2 :: (a -> b -> c) -> StateC s m a -> StateC s m b -> StateC s m c #

(*>) :: StateC s m a -> StateC s m b -> StateC s m b #

(<*) :: StateC s m a -> StateC s m b -> StateC s m a #

MonadIO m => MonadIO (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

liftIO :: IO a -> StateC s m a #

(Alternative m, Monad m) => Alternative (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

empty :: StateC s m a #

(<|>) :: StateC s m a -> StateC s m a -> StateC s m a #

some :: StateC s m a -> StateC s m [a] #

many :: StateC s m a -> StateC s m [a] #

(Alternative m, Monad m) => MonadPlus (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

mzero :: StateC s m a #

mplus :: StateC s m a -> StateC s m a -> StateC s m a #

(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # 
Instance details

Defined in Control.Effect.State.Strict

Methods

eff :: (State s :+: sig) (StateC s m) (StateC s m a) -> StateC s m a Source #

ret :: a -> StateC s m a Source #

data ReaderC r m a Source #

Instances
MonadTrans (ReaderC r) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

lift :: Monad m => m a -> ReaderC r m a #

Monad m => Monad (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

(>>=) :: ReaderC r m a -> (a -> ReaderC r m b) -> ReaderC r m b #

(>>) :: ReaderC r m a -> ReaderC r m b -> ReaderC r m b #

return :: a -> ReaderC r m a #

fail :: String -> ReaderC r m a #

Functor m => Functor (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

fmap :: (a -> b) -> ReaderC r m a -> ReaderC r m b #

(<$) :: a -> ReaderC r m b -> ReaderC r m a #

MonadFail m => MonadFail (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

fail :: String -> ReaderC r m a #

Applicative m => Applicative (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

pure :: a -> ReaderC r m a #

(<*>) :: ReaderC r m (a -> b) -> ReaderC r m a -> ReaderC r m b #

liftA2 :: (a -> b -> c) -> ReaderC r m a -> ReaderC r m b -> ReaderC r m c #

(*>) :: ReaderC r m a -> ReaderC r m b -> ReaderC r m b #

(<*) :: ReaderC r m a -> ReaderC r m b -> ReaderC r m a #

MonadIO m => MonadIO (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

liftIO :: IO a -> ReaderC r m a #

Alternative m => Alternative (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

empty :: ReaderC r m a #

(<|>) :: ReaderC r m a -> ReaderC r m a -> ReaderC r m a #

some :: ReaderC r m a -> ReaderC r m [a] #

many :: ReaderC r m a -> ReaderC r m [a] #

(Alternative m, Monad m) => MonadPlus (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

mzero :: ReaderC r m a #

mplus :: ReaderC r m a -> ReaderC r m a -> ReaderC r m a #

Carrier sig m => Carrier (Reader r :+: sig) (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

eff :: (Reader r :+: sig) (ReaderC r m) (ReaderC r m a) -> ReaderC r m a Source #

ret :: a -> ReaderC r m a Source #

data Reader r m k Source #

Instances
Effect (Reader r) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Reader r m (m a) -> Reader r n (n (f a)) Source #

HFunctor (Reader r) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

fmap' :: (a -> b) -> Reader r m a -> Reader r m b Source #

hmap :: (forall x. m x -> n x) -> Reader r m a -> Reader r n a Source #

Functor (Reader r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

fmap :: (a -> b) -> Reader r m a -> Reader r m b #

(<$) :: a -> Reader r m b -> Reader r m a #

Carrier sig m => Carrier (Reader r :+: sig) (ReaderC r m) Source # 
Instance details

Defined in Control.Effect.Reader

Methods

eff :: (Reader r :+: sig) (ReaderC r m) (ReaderC r m a) -> ReaderC r m a Source #

ret :: a -> ReaderC r m a Source #

data ResourceC m a Source #

Instances
MonadTrans ResourceC Source # 
Instance details

Defined in Control.Effect.Resource

Methods

lift :: Monad m => m a -> ResourceC m a #

Monad m => Monad (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

(>>=) :: ResourceC m a -> (a -> ResourceC m b) -> ResourceC m b #

(>>) :: ResourceC m a -> ResourceC m b -> ResourceC m b #

return :: a -> ResourceC m a #

fail :: String -> ResourceC m a #

Functor m => Functor (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

fmap :: (a -> b) -> ResourceC m a -> ResourceC m b #

(<$) :: a -> ResourceC m b -> ResourceC m a #

MonadFail m => MonadFail (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

fail :: String -> ResourceC m a #

Applicative m => Applicative (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

pure :: a -> ResourceC m a #

(<*>) :: ResourceC m (a -> b) -> ResourceC m a -> ResourceC m b #

liftA2 :: (a -> b -> c) -> ResourceC m a -> ResourceC m b -> ResourceC m c #

(*>) :: ResourceC m a -> ResourceC m b -> ResourceC m b #

(<*) :: ResourceC m a -> ResourceC m b -> ResourceC m a #

MonadIO m => MonadIO (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

liftIO :: IO a -> ResourceC m a #

Alternative m => Alternative (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

empty :: ResourceC m a #

(<|>) :: ResourceC m a -> ResourceC m a -> ResourceC m a #

some :: ResourceC m a -> ResourceC m [a] #

many :: ResourceC m a -> ResourceC m [a] #

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

Defined in Control.Effect.Resource

Methods

mzero :: ResourceC m a #

mplus :: ResourceC m a -> ResourceC m a -> ResourceC m a #

(Carrier sig m, MonadIO m) => Carrier (Resource :+: sig) (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

eff :: (Resource :+: sig) (ResourceC m) (ResourceC m a) -> ResourceC m a Source #

ret :: a -> ResourceC m a Source #

data Resource m k Source #

Instances
Effect Resource Source # 
Instance details

Defined in Control.Effect.Resource

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Resource m (m a) -> Resource n (n (f a)) Source #

HFunctor Resource Source # 
Instance details

Defined in Control.Effect.Resource

Methods

fmap' :: (a -> b) -> Resource m a -> Resource m b Source #

hmap :: (forall x. m x -> n x) -> Resource m a -> Resource n a Source #

Functor (Resource m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

fmap :: (a -> b) -> Resource m a -> Resource m b #

(<$) :: a -> Resource m b -> Resource m a #

(Carrier sig m, MonadIO m) => Carrier (Resource :+: sig) (ResourceC m) Source # 
Instance details

Defined in Control.Effect.Resource

Methods

eff :: (Resource :+: sig) (ResourceC m) (ResourceC m a) -> ResourceC m a Source #

ret :: a -> ResourceC m a Source #

data RandomC g m a Source #

Instances
MonadTrans (RandomC g) Source # 
Instance details

Defined in Control.Effect.Random

Methods

lift :: Monad m => m a -> RandomC g m a #

Monad m => Monad (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

(>>=) :: RandomC g m a -> (a -> RandomC g m b) -> RandomC g m b #

(>>) :: RandomC g m a -> RandomC g m b -> RandomC g m b #

return :: a -> RandomC g m a #

fail :: String -> RandomC g m a #

Functor m => Functor (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

fmap :: (a -> b) -> RandomC g m a -> RandomC g m b #

(<$) :: a -> RandomC g m b -> RandomC g m a #

MonadFail m => MonadFail (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

fail :: String -> RandomC g m a #

Monad m => Applicative (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

pure :: a -> RandomC g m a #

(<*>) :: RandomC g m (a -> b) -> RandomC g m a -> RandomC g m b #

liftA2 :: (a -> b -> c) -> RandomC g m a -> RandomC g m b -> RandomC g m c #

(*>) :: RandomC g m a -> RandomC g m b -> RandomC g m b #

(<*) :: RandomC g m a -> RandomC g m b -> RandomC g m a #

MonadIO m => MonadIO (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

liftIO :: IO a -> RandomC g m a #

(Alternative m, Monad m) => Alternative (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

empty :: RandomC g m a #

(<|>) :: RandomC g m a -> RandomC g m a -> RandomC g m a #

some :: RandomC g m a -> RandomC g m [a] #

many :: RandomC g m a -> RandomC g m [a] #

(Alternative m, Monad m) => MonadPlus (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

mzero :: RandomC g m a #

mplus :: RandomC g m a -> RandomC g m a -> RandomC g m a #

(Carrier sig m, Effect sig, RandomGen g) => MonadInterleave (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

interleave :: RandomC g m a -> RandomC g m a #

(Carrier sig m, Effect sig, RandomGen g) => MonadRandom (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

getRandomR :: Random a => (a, a) -> RandomC g m a #

getRandom :: Random a => RandomC g m a #

getRandomRs :: Random a => (a, a) -> RandomC g m [a] #

getRandoms :: Random a => RandomC g m [a] #

(Carrier sig m, Effect sig, RandomGen g) => Carrier (Random :+: sig) (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

eff :: (Random :+: sig) (RandomC g m) (RandomC g m a) -> RandomC g m a Source #

ret :: a -> RandomC g m a Source #

data Random m k Source #

Instances
Effect Random Source # 
Instance details

Defined in Control.Effect.Random

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Random m (m a) -> Random n (n (f a)) Source #

HFunctor Random Source # 
Instance details

Defined in Control.Effect.Random

Methods

fmap' :: (a -> b) -> Random m a -> Random m b Source #

hmap :: (forall x. m x -> n x) -> Random m a -> Random n a Source #

Functor (Random m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

fmap :: (a -> b) -> Random m a -> Random m b #

(<$) :: a -> Random m b -> Random m a #

(Carrier sig m, Effect sig, RandomGen g) => Carrier (Random :+: sig) (RandomC g m) Source # 
Instance details

Defined in Control.Effect.Random

Methods

eff :: (Random :+: sig) (RandomC g m) (RandomC g m a) -> RandomC g m a Source #

ret :: a -> RandomC g m a Source #

data NonDetC m a Source #

A carrier for NonDet effects based on Ralf Hinze’s design described in Deriving Backtracking Monad Transformers.

Instances
MonadTrans NonDetC Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

lift :: Monad m => m a -> NonDetC m a #

Monad (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

(>>=) :: NonDetC m a -> (a -> NonDetC m b) -> NonDetC m b #

(>>) :: NonDetC m a -> NonDetC m b -> NonDetC m b #

return :: a -> NonDetC m a #

fail :: String -> NonDetC m a #

Functor (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

fmap :: (a -> b) -> NonDetC m a -> NonDetC m b #

(<$) :: a -> NonDetC m b -> NonDetC m a #

MonadFail m => MonadFail (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

fail :: String -> NonDetC m a #

Applicative (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

pure :: a -> NonDetC m a #

(<*>) :: NonDetC m (a -> b) -> NonDetC m a -> NonDetC m b #

liftA2 :: (a -> b -> c) -> NonDetC m a -> NonDetC m b -> NonDetC m c #

(*>) :: NonDetC m a -> NonDetC m b -> NonDetC m b #

(<*) :: NonDetC m a -> NonDetC m b -> NonDetC m a #

MonadIO m => MonadIO (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

liftIO :: IO a -> NonDetC m a #

Alternative (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

empty :: NonDetC m a #

(<|>) :: NonDetC m a -> NonDetC m a -> NonDetC m a #

some :: NonDetC m a -> NonDetC m [a] #

many :: NonDetC m a -> NonDetC m [a] #

MonadPlus (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

mzero :: NonDetC m a #

mplus :: NonDetC m a -> NonDetC m a -> NonDetC m a #

(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

eff :: (NonDet :+: sig) (NonDetC m) (NonDetC m a) -> NonDetC m a Source #

ret :: a -> NonDetC m a Source #

data NonDet (m :: * -> *) k Source #

Instances
Effect NonDet Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> NonDet m (m a) -> NonDet n (n (f a)) Source #

HFunctor NonDet Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

fmap' :: (a -> b) -> NonDet m a -> NonDet m b Source #

hmap :: (forall x. m x -> n x) -> NonDet m a -> NonDet n a Source #

Functor (NonDet m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

fmap :: (a -> b) -> NonDet m a -> NonDet m b #

(<$) :: a -> NonDet m b -> NonDet m a #

(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (NonDetC m) Source # 
Instance details

Defined in Control.Effect.NonDet

Methods

eff :: (NonDet :+: sig) (NonDetC m) (NonDetC m a) -> NonDetC m a Source #

ret :: a -> NonDetC m a Source #

(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

eff :: (NonDet :+: sig) (OnceC m) (OnceC m a) -> OnceC m a Source #

ret :: a -> OnceC m a Source #

(Carrier sig m, Effect sig) => Carrier (Cut :+: (NonDet :+: sig)) (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

eff :: (Cut :+: (NonDet :+: sig)) (CutC m) (CutC m a) -> CutC m a Source #

ret :: a -> CutC m a Source #

(Carrier sig m, Effect sig) => Carrier (Cull :+: (NonDet :+: sig)) (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

eff :: (Cull :+: (NonDet :+: sig)) (CullC m) (CullC m a) -> CullC m a Source #

ret :: a -> CullC m a Source #

data LiftC m a Source #

Instances
MonadTrans LiftC Source # 
Instance details

Defined in Control.Effect.Lift

Methods

lift :: Monad m => m a -> LiftC m a #

Monad m => Monad (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

(>>=) :: LiftC m a -> (a -> LiftC m b) -> LiftC m b #

(>>) :: LiftC m a -> LiftC m b -> LiftC m b #

return :: a -> LiftC m a #

fail :: String -> LiftC m a #

Functor m => Functor (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

fmap :: (a -> b) -> LiftC m a -> LiftC m b #

(<$) :: a -> LiftC m b -> LiftC m a #

MonadFail m => MonadFail (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

fail :: String -> LiftC m a #

Applicative m => Applicative (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

pure :: a -> LiftC m a #

(<*>) :: LiftC m (a -> b) -> LiftC m a -> LiftC m b #

liftA2 :: (a -> b -> c) -> LiftC m a -> LiftC m b -> LiftC m c #

(*>) :: LiftC m a -> LiftC m b -> LiftC m b #

(<*) :: LiftC m a -> LiftC m b -> LiftC m a #

MonadIO m => MonadIO (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

liftIO :: IO a -> LiftC m a #

Alternative m => Alternative (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

empty :: LiftC m a #

(<|>) :: LiftC m a -> LiftC m a -> LiftC m a #

some :: LiftC m a -> LiftC m [a] #

many :: LiftC m a -> LiftC m [a] #

MonadPlus m => MonadPlus (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

mzero :: LiftC m a #

mplus :: LiftC m a -> LiftC m a -> LiftC m a #

Monad m => Carrier (Lift m) (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

eff :: Lift m (LiftC m) (LiftC m a) -> LiftC m a Source #

ret :: a -> LiftC m a Source #

data Lift sig (m :: * -> *) k Source #

Instances
Functor sig => Effect (Lift sig) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Lift sig m (m a) -> Lift sig n (n (f a)) Source #

Functor sig => HFunctor (Lift sig) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

fmap' :: (a -> b) -> Lift sig m a -> Lift sig m b Source #

hmap :: (forall x. m x -> n x) -> Lift sig m a -> Lift sig n a Source #

Monad m => Carrier (Lift m) (LiftC m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

eff :: Lift m (LiftC m) (LiftC m a) -> LiftC m a Source #

ret :: a -> LiftC m a Source #

Functor sig => Functor (Lift sig m) Source # 
Instance details

Defined in Control.Effect.Lift

Methods

fmap :: (a -> b) -> Lift sig m a -> Lift sig m b #

(<$) :: a -> Lift sig m b -> Lift sig m a #

runM :: LiftC m a -> m a Source #

Extract a Lifted Monadic action from an effectful computation.

data FreshC m a Source #

Instances
MonadTrans FreshC Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

lift :: Monad m => m a -> FreshC m a #

Monad m => Monad (FreshC m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

(>>=) :: FreshC m a -> (a -> FreshC m b) -> FreshC m b #

(>>) :: FreshC m a -> FreshC m b -> FreshC m b #

return :: a -> FreshC m a #

fail :: String -> FreshC m a #

Functor m => Functor (FreshC m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

fmap :: (a -> b) -> FreshC m a -> FreshC m b #

(<$) :: a -> FreshC m b -> FreshC m a #

MonadFail m => MonadFail (FreshC m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

fail :: String -> FreshC m a #

Monad m => Applicative (FreshC m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

pure :: a -> FreshC m a #

(<*>) :: FreshC m (a -> b) -> FreshC m a -> FreshC m b #

liftA2 :: (a -> b -> c) -> FreshC m a -> FreshC m b -> FreshC m c #

(*>) :: FreshC m a -> FreshC m b -> FreshC m b #

(<*) :: FreshC m a -> FreshC m b -> FreshC m a #

MonadIO m => MonadIO (FreshC m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

liftIO :: IO a -> FreshC m a #

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

Defined in Control.Effect.Fresh

Methods

empty :: FreshC m a #

(<|>) :: FreshC m a -> FreshC m a -> FreshC m a #

some :: FreshC m a -> FreshC m [a] #

many :: FreshC m a -> FreshC m [a] #

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

Defined in Control.Effect.Fresh

Methods

mzero :: FreshC m a #

mplus :: FreshC m a -> FreshC m a -> FreshC m a #

(Carrier sig m, Effect sig) => Carrier (Fresh :+: sig) (FreshC m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

eff :: (Fresh :+: sig) (FreshC m) (FreshC m a) -> FreshC m a Source #

ret :: a -> FreshC m a Source #

data Fresh m k Source #

Instances
Effect Fresh Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Fresh m (m a) -> Fresh n (n (f a)) Source #

HFunctor Fresh Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

fmap' :: (a -> b) -> Fresh m a -> Fresh m b Source #

hmap :: (forall x. m x -> n x) -> Fresh m a -> Fresh n a Source #

Functor (Fresh m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

fmap :: (a -> b) -> Fresh m a -> Fresh m b #

(<$) :: a -> Fresh m b -> Fresh m a #

(Carrier sig m, Effect sig) => Carrier (Fresh :+: sig) (FreshC m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

eff :: (Fresh :+: sig) (FreshC m) (FreshC m a) -> FreshC m a Source #

ret :: a -> FreshC m a Source #

data ErrorC e m a Source #

Instances
MonadTrans (ErrorC e) Source # 
Instance details

Defined in Control.Effect.Error

Methods

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

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

Defined in Control.Effect.Error

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 #

fail :: String -> ErrorC e m a #

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

Defined in Control.Effect.Error

Methods

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

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

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

Defined in Control.Effect.Error

Methods

fail :: String -> ErrorC e m a #

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

Defined in Control.Effect.Error

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.Effect.Error

Methods

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

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

Defined in Control.Effect.Error

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 # 
Instance details

Defined in Control.Effect.Error

Methods

mzero :: ErrorC e m a #

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

(Carrier sig m, Effect sig) => Carrier (Error e :+: sig) (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Error

Methods

eff :: (Error e :+: sig) (ErrorC e m) (ErrorC e m a) -> ErrorC e m a Source #

ret :: a -> ErrorC e m a Source #

data Error exc m k Source #

Instances
Effect (Error exc) Source # 
Instance details

Defined in Control.Effect.Error

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Error exc m (m a) -> Error exc n (n (f a)) Source #

HFunctor (Error exc) Source # 
Instance details

Defined in Control.Effect.Error

Methods

fmap' :: (a -> b) -> Error exc m a -> Error exc m b Source #

hmap :: (forall x. m x -> n x) -> Error exc m a -> Error exc n a Source #

Functor (Error exc m) Source # 
Instance details

Defined in Control.Effect.Error

Methods

fmap :: (a -> b) -> Error exc m a -> Error exc m b #

(<$) :: a -> Error exc m b -> Error exc m a #

(Carrier sig m, Effect sig) => Carrier (Error e :+: sig) (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Error

Methods

eff :: (Error e :+: sig) (ErrorC e m) (ErrorC e m a) -> ErrorC e m a Source #

ret :: a -> ErrorC e m a Source #

data ResumableWithC err m a Source #

Instances
MonadTrans (ResumableWithC err) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

lift :: Monad m => m a -> ResumableWithC err m a #

Monad m => Monad (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

(>>=) :: ResumableWithC err m a -> (a -> ResumableWithC err m b) -> ResumableWithC err m b #

(>>) :: ResumableWithC err m a -> ResumableWithC err m b -> ResumableWithC err m b #

return :: a -> ResumableWithC err m a #

fail :: String -> ResumableWithC err m a #

Functor m => Functor (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

fmap :: (a -> b) -> ResumableWithC err m a -> ResumableWithC err m b #

(<$) :: a -> ResumableWithC err m b -> ResumableWithC err m a #

MonadFail m => MonadFail (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

fail :: String -> ResumableWithC err m a #

Applicative m => Applicative (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

pure :: a -> ResumableWithC err m a #

(<*>) :: ResumableWithC err m (a -> b) -> ResumableWithC err m a -> ResumableWithC err m b #

liftA2 :: (a -> b -> c) -> ResumableWithC err m a -> ResumableWithC err m b -> ResumableWithC err m c #

(*>) :: ResumableWithC err m a -> ResumableWithC err m b -> ResumableWithC err m b #

(<*) :: ResumableWithC err m a -> ResumableWithC err m b -> ResumableWithC err m a #

MonadIO m => MonadIO (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

liftIO :: IO a -> ResumableWithC err m a #

Alternative m => Alternative (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

empty :: ResumableWithC err m a #

(<|>) :: ResumableWithC err m a -> ResumableWithC err m a -> ResumableWithC err m a #

some :: ResumableWithC err m a -> ResumableWithC err m [a] #

many :: ResumableWithC err m a -> ResumableWithC err m [a] #

(Alternative m, Monad m) => MonadPlus (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

mzero :: ResumableWithC err m a #

mplus :: ResumableWithC err m a -> ResumableWithC err m a -> ResumableWithC err m a #

Carrier sig m => Carrier (Resumable err :+: sig) (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

eff :: (Resumable err :+: sig) (ResumableWithC err m) (ResumableWithC err m a) -> ResumableWithC err m a Source #

ret :: a -> ResumableWithC err m a Source #

data ResumableC err m a Source #

Instances
MonadTrans (ResumableC err) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

lift :: Monad m => m a -> ResumableC err m a #

Monad m => Monad (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

(>>=) :: ResumableC err m a -> (a -> ResumableC err m b) -> ResumableC err m b #

(>>) :: ResumableC err m a -> ResumableC err m b -> ResumableC err m b #

return :: a -> ResumableC err m a #

fail :: String -> ResumableC err m a #

Functor m => Functor (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

fmap :: (a -> b) -> ResumableC err m a -> ResumableC err m b #

(<$) :: a -> ResumableC err m b -> ResumableC err m a #

MonadFail m => MonadFail (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

fail :: String -> ResumableC err m a #

Applicative m => Applicative (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

pure :: a -> ResumableC err m a #

(<*>) :: ResumableC err m (a -> b) -> ResumableC err m a -> ResumableC err m b #

liftA2 :: (a -> b -> c) -> ResumableC err m a -> ResumableC err m b -> ResumableC err m c #

(*>) :: ResumableC err m a -> ResumableC err m b -> ResumableC err m b #

(<*) :: ResumableC err m a -> ResumableC err m b -> ResumableC err m a #

MonadIO m => MonadIO (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

liftIO :: IO a -> ResumableC err m a #

Alternative m => Alternative (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

empty :: ResumableC err m a #

(<|>) :: ResumableC err m a -> ResumableC err m a -> ResumableC err m a #

some :: ResumableC err m a -> ResumableC err m [a] #

many :: ResumableC err m a -> ResumableC err m [a] #

(Alternative m, Monad m) => MonadPlus (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

mzero :: ResumableC err m a #

mplus :: ResumableC err m a -> ResumableC err m a -> ResumableC err m a #

(Carrier sig m, Effect sig) => Carrier (Resumable err :+: sig) (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

eff :: (Resumable err :+: sig) (ResumableC err m) (ResumableC err m a) -> ResumableC err m a Source #

ret :: a -> ResumableC err m a Source #

data Resumable err (m :: * -> *) k Source #

Errors which can be resumed with values of some existentially-quantified type.

Instances
Effect (Resumable err) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Resumable err m (m a) -> Resumable err n (n (f a)) Source #

HFunctor (Resumable err) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

fmap' :: (a -> b) -> Resumable err m a -> Resumable err m b Source #

hmap :: (forall x. m x -> n x) -> Resumable err m a -> Resumable err n a Source #

Functor (Resumable err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

fmap :: (a -> b) -> Resumable err m a -> Resumable err m b #

(<$) :: a -> Resumable err m b -> Resumable err m a #

Carrier sig m => Carrier (Resumable err :+: sig) (ResumableWithC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

eff :: (Resumable err :+: sig) (ResumableWithC err m) (ResumableWithC err m a) -> ResumableWithC err m a Source #

ret :: a -> ResumableWithC err m a Source #

(Carrier sig m, Effect sig) => Carrier (Resumable err :+: sig) (ResumableC err m) Source # 
Instance details

Defined in Control.Effect.Resumable

Methods

eff :: (Resumable err :+: sig) (ResumableC err m) (ResumableC err m a) -> ResumableC err m a Source #

ret :: a -> ResumableC err m a Source #

data FailC m a Source #

Instances
MonadTrans FailC Source # 
Instance details

Defined in Control.Effect.Fail

Methods

lift :: Monad m => m a -> FailC m a #

Monad m => Monad (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

(>>=) :: FailC m a -> (a -> FailC m b) -> FailC m b #

(>>) :: FailC m a -> FailC m b -> FailC m b #

return :: a -> FailC m a #

fail :: String -> FailC m a #

Functor m => Functor (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

fmap :: (a -> b) -> FailC m a -> FailC m b #

(<$) :: a -> FailC m b -> FailC m a #

(Carrier sig m, Effect sig) => MonadFail (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

fail :: String -> FailC m a #

Applicative m => Applicative (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

pure :: a -> FailC m a #

(<*>) :: FailC m (a -> b) -> FailC m a -> FailC m b #

liftA2 :: (a -> b -> c) -> FailC m a -> FailC m b -> FailC m c #

(*>) :: FailC m a -> FailC m b -> FailC m b #

(<*) :: FailC m a -> FailC m b -> FailC m a #

MonadIO m => MonadIO (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

liftIO :: IO a -> FailC m a #

Alternative m => Alternative (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

empty :: FailC m a #

(<|>) :: FailC m a -> FailC m a -> FailC m a #

some :: FailC m a -> FailC m [a] #

many :: FailC m a -> FailC m [a] #

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

Defined in Control.Effect.Fail

Methods

mzero :: FailC m a #

mplus :: FailC m a -> FailC m a -> FailC m a #

(Carrier sig m, Effect sig) => Carrier (Fail :+: sig) (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

eff :: (Fail :+: sig) (FailC m) (FailC m a) -> FailC m a Source #

ret :: a -> FailC m a Source #

data Fail (m :: * -> *) k Source #

Instances
Effect Fail Source # 
Instance details

Defined in Control.Effect.Fail

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Fail m (m a) -> Fail n (n (f a)) Source #

HFunctor Fail Source # 
Instance details

Defined in Control.Effect.Fail

Methods

fmap' :: (a -> b) -> Fail m a -> Fail m b Source #

hmap :: (forall x. m x -> n x) -> Fail m a -> Fail n a Source #

Functor (Fail m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

fmap :: (a -> b) -> Fail m a -> Fail m b #

(<$) :: a -> Fail m b -> Fail m a #

(Carrier sig m, Effect sig) => Carrier (Fail :+: sig) (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

eff :: (Fail :+: sig) (FailC m) (FailC m a) -> FailC m a Source #

ret :: a -> FailC m a Source #

data CutC m a Source #

Instances
MonadTrans CutC Source # 
Instance details

Defined in Control.Effect.Cut

Methods

lift :: Monad m => m a -> CutC m a #

Monad (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

(>>=) :: CutC m a -> (a -> CutC m b) -> CutC m b #

(>>) :: CutC m a -> CutC m b -> CutC m b #

return :: a -> CutC m a #

fail :: String -> CutC m a #

Functor (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

fmap :: (a -> b) -> CutC m a -> CutC m b #

(<$) :: a -> CutC m b -> CutC m a #

MonadFail m => MonadFail (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

fail :: String -> CutC m a #

Applicative (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

pure :: a -> CutC m a #

(<*>) :: CutC m (a -> b) -> CutC m a -> CutC m b #

liftA2 :: (a -> b -> c) -> CutC m a -> CutC m b -> CutC m c #

(*>) :: CutC m a -> CutC m b -> CutC m b #

(<*) :: CutC m a -> CutC m b -> CutC m a #

MonadIO m => MonadIO (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

liftIO :: IO a -> CutC m a #

Alternative (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

empty :: CutC m a #

(<|>) :: CutC m a -> CutC m a -> CutC m a #

some :: CutC m a -> CutC m [a] #

many :: CutC m a -> CutC m [a] #

MonadPlus (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

mzero :: CutC m a #

mplus :: CutC m a -> CutC m a -> CutC m a #

(Carrier sig m, Effect sig) => Carrier (Cut :+: (NonDet :+: sig)) (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

eff :: (Cut :+: (NonDet :+: sig)) (CutC m) (CutC m a) -> CutC m a Source #

ret :: a -> CutC m a Source #

data Cut m k Source #

Cut effects are used with NonDet to provide control over backtracking.

Instances
Effect Cut Source # 
Instance details

Defined in Control.Effect.Cut

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Cut m (m a) -> Cut n (n (f a)) Source #

HFunctor Cut Source # 
Instance details

Defined in Control.Effect.Cut

Methods

fmap' :: (a -> b) -> Cut m a -> Cut m b Source #

hmap :: (forall x. m x -> n x) -> Cut m a -> Cut n a Source #

Functor (Cut m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

fmap :: (a -> b) -> Cut m a -> Cut m b #

(<$) :: a -> Cut m b -> Cut m a #

(Carrier sig m, Effect sig) => Carrier (Cut :+: (NonDet :+: sig)) (CutC m) Source # 
Instance details

Defined in Control.Effect.Cut

Methods

eff :: (Cut :+: (NonDet :+: sig)) (CutC m) (CutC m a) -> CutC m a Source #

ret :: a -> CutC m a Source #

data OnceC m a Source #

Instances
Monad (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

(>>=) :: OnceC m a -> (a -> OnceC m b) -> OnceC m b #

(>>) :: OnceC m a -> OnceC m b -> OnceC m b #

return :: a -> OnceC m a #

fail :: String -> OnceC m a #

Functor (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

fmap :: (a -> b) -> OnceC m a -> OnceC m b #

(<$) :: a -> OnceC m b -> OnceC m a #

MonadFail m => MonadFail (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

fail :: String -> OnceC m a #

Applicative (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

pure :: a -> OnceC m a #

(<*>) :: OnceC m (a -> b) -> OnceC m a -> OnceC m b #

liftA2 :: (a -> b -> c) -> OnceC m a -> OnceC m b -> OnceC m c #

(*>) :: OnceC m a -> OnceC m b -> OnceC m b #

(<*) :: OnceC m a -> OnceC m b -> OnceC m a #

MonadIO m => MonadIO (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

liftIO :: IO a -> OnceC m a #

Alternative (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

empty :: OnceC m a #

(<|>) :: OnceC m a -> OnceC m a -> OnceC m a #

some :: OnceC m a -> OnceC m [a] #

many :: OnceC m a -> OnceC m [a] #

MonadPlus (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

mzero :: OnceC m a #

mplus :: OnceC m a -> OnceC m a -> OnceC m a #

(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (OnceC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

eff :: (NonDet :+: sig) (OnceC m) (OnceC m a) -> OnceC m a Source #

ret :: a -> OnceC m a Source #

data CullC m a Source #

Instances
MonadTrans CullC Source # 
Instance details

Defined in Control.Effect.Cull

Methods

lift :: Monad m => m a -> CullC m a #

Monad (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

(>>=) :: CullC m a -> (a -> CullC m b) -> CullC m b #

(>>) :: CullC m a -> CullC m b -> CullC m b #

return :: a -> CullC m a #

fail :: String -> CullC m a #

Functor (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

fmap :: (a -> b) -> CullC m a -> CullC m b #

(<$) :: a -> CullC m b -> CullC m a #

MonadFail m => MonadFail (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

fail :: String -> CullC m a #

Applicative (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

pure :: a -> CullC m a #

(<*>) :: CullC m (a -> b) -> CullC m a -> CullC m b #

liftA2 :: (a -> b -> c) -> CullC m a -> CullC m b -> CullC m c #

(*>) :: CullC m a -> CullC m b -> CullC m b #

(<*) :: CullC m a -> CullC m b -> CullC m a #

MonadIO m => MonadIO (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

liftIO :: IO a -> CullC m a #

Alternative (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

empty :: CullC m a #

(<|>) :: CullC m a -> CullC m a -> CullC m a #

some :: CullC m a -> CullC m [a] #

many :: CullC m a -> CullC m [a] #

MonadPlus (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

mzero :: CullC m a #

mplus :: CullC m a -> CullC m a -> CullC m a #

(Carrier sig m, Effect sig) => Carrier (Cull :+: (NonDet :+: sig)) (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

eff :: (Cull :+: (NonDet :+: sig)) (CullC m) (CullC m a) -> CullC m a Source #

ret :: a -> CullC m a Source #

data Cull m k Source #

Cull effects are used with NonDet to provide control over branching.

Instances
Effect Cull Source # 
Instance details

Defined in Control.Effect.Cull

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Cull m (m a) -> Cull n (n (f a)) Source #

HFunctor Cull Source # 
Instance details

Defined in Control.Effect.Cull

Methods

fmap' :: (a -> b) -> Cull m a -> Cull m b Source #

hmap :: (forall x. m x -> n x) -> Cull m a -> Cull n a Source #

Functor (Cull m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

fmap :: (a -> b) -> Cull m a -> Cull m b #

(<$) :: a -> Cull m b -> Cull m a #

(Carrier sig m, Effect sig) => Carrier (Cull :+: (NonDet :+: sig)) (CullC m) Source # 
Instance details

Defined in Control.Effect.Cull

Methods

eff :: (Cull :+: (NonDet :+: sig)) (CullC m) (CullC m a) -> CullC m a Source #

ret :: a -> CullC m a Source #

data TraceByReturningC m a Source #

Instances
MonadTrans TraceByReturningC Source # 
Instance details

Defined in Control.Effect.Trace

Methods

lift :: Monad m => m a -> TraceByReturningC m a #

Monad m => Monad (TraceByReturningC m) Source # 
Instance details

Defined in Control.Effect.Trace

Functor m => Functor (TraceByReturningC m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

fmap :: (a -> b) -> TraceByReturningC m a -> TraceByReturningC m b #

(<$) :: a -> TraceByReturningC m b -> TraceByReturningC m a #

MonadFail m => MonadFail (TraceByReturningC m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

fail :: String -> TraceByReturningC m a #

Monad m => Applicative (TraceByReturningC m) Source # 
Instance details

Defined in Control.Effect.Trace

MonadIO m => MonadIO (TraceByReturningC m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

liftIO :: IO a -> TraceByReturningC m a #

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

Defined in Control.Effect.Trace

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

Defined in Control.Effect.Trace

(Carrier sig m, Effect sig) => Carrier (Trace :+: sig) (TraceByReturningC m) Source # 
Instance details

Defined in Control.Effect.Trace

data TraceByIgnoringC m a Source #

Instances
MonadTrans TraceByIgnoringC Source # 
Instance details

Defined in Control.Effect.Trace

Methods

lift :: Monad m => m a -> TraceByIgnoringC m a #

Monad m => Monad (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

Functor m => Functor (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

fmap :: (a -> b) -> TraceByIgnoringC m a -> TraceByIgnoringC m b #

(<$) :: a -> TraceByIgnoringC m b -> TraceByIgnoringC m a #

MonadFail m => MonadFail (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

fail :: String -> TraceByIgnoringC m a #

Applicative m => Applicative (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

MonadIO m => MonadIO (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

liftIO :: IO a -> TraceByIgnoringC m a #

Alternative m => Alternative (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

MonadPlus m => MonadPlus (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

Carrier sig m => Carrier (Trace :+: sig) (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

data TraceByPrintingC m a Source #

Instances
MonadTrans TraceByPrintingC Source # 
Instance details

Defined in Control.Effect.Trace

Methods

lift :: Monad m => m a -> TraceByPrintingC m a #

Monad m => Monad (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

Functor m => Functor (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

fmap :: (a -> b) -> TraceByPrintingC m a -> TraceByPrintingC m b #

(<$) :: a -> TraceByPrintingC m b -> TraceByPrintingC m a #

MonadFail m => MonadFail (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

fail :: String -> TraceByPrintingC m a #

Applicative m => Applicative (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

MonadIO m => MonadIO (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

liftIO :: IO a -> TraceByPrintingC m a #

Alternative m => Alternative (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

MonadPlus m => MonadPlus (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

(MonadIO m, Carrier sig m) => Carrier (Trace :+: sig) (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

data Trace (m :: * -> *) k Source #

Instances
Effect Trace Source # 
Instance details

Defined in Control.Effect.Trace

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Trace m (m a) -> Trace n (n (f a)) Source #

HFunctor Trace Source # 
Instance details

Defined in Control.Effect.Trace

Methods

fmap' :: (a -> b) -> Trace m a -> Trace m b Source #

hmap :: (forall x. m x -> n x) -> Trace m a -> Trace n a Source #

Functor (Trace m) Source # 
Instance details

Defined in Control.Effect.Trace

Methods

fmap :: (a -> b) -> Trace m a -> Trace m b #

(<$) :: a -> Trace m b -> Trace m a #

(Carrier sig m, Effect sig) => Carrier (Trace :+: sig) (TraceByReturningC m) Source # 
Instance details

Defined in Control.Effect.Trace

Carrier sig m => Carrier (Trace :+: sig) (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

(MonadIO m, Carrier sig m) => Carrier (Trace :+: sig) (TraceByPrintingC m) Source # 
Instance details

Defined in Control.Effect.Trace

data WriterC w m a Source #

A space-efficient carrier for Writer effects.

This is based on a post Gabriel Gonzalez made to the Haskell mailing list: https://mail.haskell.org/pipermail/libraries/2013-March/019528.html

Instances
MonadTrans (WriterC w) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

lift :: Monad m => m a -> WriterC w m a #

Monad m => Monad (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

(>>=) :: WriterC w m a -> (a -> WriterC w m b) -> WriterC w m b #

(>>) :: WriterC w m a -> WriterC w m b -> WriterC w m b #

return :: a -> WriterC w m a #

fail :: String -> WriterC w m a #

Functor m => Functor (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

fmap :: (a -> b) -> WriterC w m a -> WriterC w m b #

(<$) :: a -> WriterC w m b -> WriterC w m a #

MonadFail m => MonadFail (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

fail :: String -> WriterC w m a #

Monad m => Applicative (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

pure :: a -> WriterC w m a #

(<*>) :: WriterC w m (a -> b) -> WriterC w m a -> WriterC w m b #

liftA2 :: (a -> b -> c) -> WriterC w m a -> WriterC w m b -> WriterC w m c #

(*>) :: WriterC w m a -> WriterC w m b -> WriterC w m b #

(<*) :: WriterC w m a -> WriterC w m b -> WriterC w m a #

MonadIO m => MonadIO (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

liftIO :: IO a -> WriterC w m a #

(Alternative m, Monad m) => Alternative (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

empty :: WriterC w m a #

(<|>) :: WriterC w m a -> WriterC w m a -> WriterC w m a #

some :: WriterC w m a -> WriterC w m [a] #

many :: WriterC w m a -> WriterC w m [a] #

(Alternative m, Monad m) => MonadPlus (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

mzero :: WriterC w m a #

mplus :: WriterC w m a -> WriterC w m a -> WriterC w m a #

(Monoid w, Carrier sig m, Effect sig) => Carrier (Writer w :+: sig) (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

eff :: (Writer w :+: sig) (WriterC w m) (WriterC w m a) -> WriterC w m a Source #

ret :: a -> WriterC w m a Source #

data Writer w m k Source #

Instances
Effect (Writer w) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

handle :: Functor f => f () -> (forall x. f (m x) -> n (f x)) -> Writer w m (m a) -> Writer w n (n (f a)) Source #

HFunctor (Writer w) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

fmap' :: (a -> b) -> Writer w m a -> Writer w m b Source #

hmap :: (forall x. m x -> n x) -> Writer w m a -> Writer w n a Source #

Functor (Writer w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

fmap :: (a -> b) -> Writer w m a -> Writer w m b #

(<$) :: a -> Writer w m b -> Writer w m a #

(Monoid w, Carrier sig m, Effect sig) => Carrier (Writer w :+: sig) (WriterC w m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

eff :: (Writer w :+: sig) (WriterC w m) (WriterC w m a) -> WriterC w m a Source #

ret :: a -> WriterC w m a Source #

type Eff m = m Source #

Deprecated: Carriers are now monads; use m instead of Eff m.