Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PureC a
- data Pure (m :: * -> *) k
- run :: PureC a -> a
- class Member (sub :: (* -> *) -> * -> *) sup
- data (f :+: g) (m :: * -> *) k
- class (HFunctor sig, Monad m) => Carrier sig m | m -> sig
- class HFunctor sig => Effect sig
- data State s m k
- data StateC s m a
- data ReaderC r m a
- data Reader r m k
- data ResourceC m a
- data Resource m k
- data RandomC g m a
- data Random m k
- data NonDetC m a
- data NonDet m k
- data LiftC m a
- data Lift sig m k
- runM :: LiftC m a -> m a
- data FreshC m a
- data Fresh m k
- data ErrorC e m a
- data Error exc m k
- data ResumableWithC err m a
- data ResumableC err m a
- data Resumable err m k
- data FailC m a
- data Fail (m :: * -> *) k
- data CutC m a
- data Cut m k
- data OnceC m a
- data CullC m a
- data Cull m k
- data TraceByReturningC m a
- data TraceByIgnoringC m a
- data TraceByPrintingC m a
- data Trace m k
- data WriterC w m a
- data Writer w m k
Documentation
data (f :+: g) (m :: * -> *) k infixr 4 Source #
Instances
Member sub sup => Member sub (sub' :+: sup) Source # | |
Member sub (sub :+: sup) Source # | |
Generic1 ((f :+: g) m :: Type -> Type) Source # | |
(Effect f, Effect g) => Effect (f :+: g) Source # | |
(HFunctor f, HFunctor g) => HFunctor (f :+: g) Source # | |
(Carrier sig m, MonadIO m) => Carrier (Resource :+: sig) (ResourceC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (NonDetC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (OnceC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Fresh :+: sig) (FreshC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Fail :+: sig) (FailC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Cut :+: (NonDet :+: sig)) (CutC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Cull :+: (NonDet :+: sig)) (CullC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Trace :+: sig) (TraceByReturningC m) Source # | |
Defined in Control.Effect.Trace eff :: (Trace :+: sig) (TraceByReturningC m) a -> TraceByReturningC m a Source # | |
Carrier sig m => Carrier (Trace :+: sig) (TraceByIgnoringC m) Source # | |
Defined in Control.Effect.Trace eff :: (Trace :+: sig) (TraceByIgnoringC m) a -> TraceByIgnoringC m a Source # | |
(MonadIO m, Carrier sig m) => Carrier (Trace :+: sig) (TraceByPrintingC m) Source # | |
Defined in Control.Effect.Trace eff :: (Trace :+: sig) (TraceByPrintingC m) a -> TraceByPrintingC m a Source # | |
(HFunctor eff, Carrier sig m) => Carrier (eff :+: sig) (InterpretC eff m) Source # | |
Defined in Control.Effect.Interpret eff :: (eff :+: sig) (InterpretC eff m) a -> InterpretC eff m a Source # | |
(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # | |
(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # | |
Carrier sig m => Carrier (Reader r :+: sig) (ReaderC r m) Source # | |
(Carrier sig m, Effect sig, RandomGen g) => Carrier (Random :+: sig) (RandomC g m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Error e :+: sig) (ErrorC e m) Source # | |
Carrier sig m => Carrier (Resumable err :+: sig) (ResumableWithC err m) Source # | |
Defined in Control.Effect.Resumable eff :: (Resumable err :+: sig) (ResumableWithC err m) a -> ResumableWithC err m a Source # | |
(Carrier sig m, Effect sig) => Carrier (Resumable err :+: sig) (ResumableC err m) Source # | |
Defined in Control.Effect.Resumable eff :: (Resumable err :+: sig) (ResumableC err m) a -> ResumableC err m a Source # | |
(Monoid w, Carrier sig m, Effect sig) => Carrier (Writer w :+: sig) (WriterC w m) Source # | |
(HFunctor eff, Carrier sig m, Effect sig) => Carrier (eff :+: sig) (InterpretStateC eff s m) Source # | |
Defined in Control.Effect.Interpret eff :: (eff :+: sig) (InterpretStateC eff s m) a -> InterpretStateC eff s m a Source # | |
(Functor (f m), Functor (g m)) => Functor ((f :+: g) m) Source # | |
(Foldable (f m), Foldable (g m)) => Foldable ((f :+: g) m) Source # | |
Defined in Control.Effect.Sum fold :: Monoid m0 => (f :+: g) m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> (f :+: g) m a -> m0 # foldMap' :: Monoid m0 => (a -> m0) -> (f :+: g) m a -> m0 # foldr :: (a -> b -> b) -> b -> (f :+: g) m a -> b # foldr' :: (a -> b -> b) -> b -> (f :+: g) m a -> b # foldl :: (b -> a -> b) -> b -> (f :+: g) m a -> b # foldl' :: (b -> a -> b) -> b -> (f :+: g) m a -> b # foldr1 :: (a -> a -> a) -> (f :+: g) m a -> a # foldl1 :: (a -> a -> a) -> (f :+: g) m a -> a # toList :: (f :+: g) m a -> [a] # null :: (f :+: g) m a -> Bool # length :: (f :+: g) m a -> Int # elem :: Eq a => a -> (f :+: g) m a -> Bool # maximum :: Ord a => (f :+: g) m a -> a # minimum :: Ord a => (f :+: g) m a -> a # | |
(Traversable (f m), Traversable (g m)) => Traversable ((f :+: g) m) Source # | |
Defined in Control.Effect.Sum | |
(Eq (f m k), Eq (g m k)) => Eq ((f :+: g) m k) Source # | |
(Ord (f m k), Ord (g m k)) => Ord ((f :+: g) m k) Source # | |
Defined in Control.Effect.Sum 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 # | |
(Show (f m k), Show (g m k)) => Show ((f :+: g) m k) Source # | |
type Rep1 ((f :+: g) m :: Type -> Type) Source # | |
Defined in Control.Effect.Sum type Rep1 ((f :+: g) m :: Type -> Type) = D1 ('MetaData ":+:" "Control.Effect.Sum" "fused-effects-0.5.0.1-inplace" 'False) (C1 ('MetaCons "L" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 (f m))) :+: C1 ('MetaCons "R" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 (g m)))) |
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.
Instances
class HFunctor sig => Effect sig Source #
The class of effect types, which must:
- Be functorial in their last two arguments, and
- Support threading effects in higher-order positions through using the carrier’s suspended state.
All first-order effects (those without existential occurrences of m
) admit a default definition of handle
provided a Generic1
instance is available for the effect.
Instances
Effect Pure Source # | |
Effect Resource Source # | |
Effect Random Source # | |
Effect NonDet Source # | |
Effect Fresh Source # | |
Effect Fail Source # | |
Effect Cut Source # | |
Effect Cull Source # | |
Effect Trace Source # | |
Effect (State s) Source # | |
Effect (Reader r) Source # | |
Functor sig => Effect (Lift sig) Source # | |
Effect (Error exc) Source # | |
Effect (Resumable err) Source # | |
Effect (Writer w) Source # | |
(Effect f, Effect g) => Effect (f :+: g) Source # | |
Instances
Effect (State s) Source # | |
HFunctor (State s) Source # | |
Generic1 (State s m :: Type -> Type) Source # | |
Functor m => Functor (State s m) Source # | |
(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # | |
(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # | |
type Rep1 (State s m :: Type -> Type) Source # | |
Defined in Control.Effect.State.Internal type Rep1 (State s m :: Type -> Type) = D1 ('MetaData "State" "Control.Effect.State.Internal" "fused-effects-0.5.0.1-inplace" 'False) (C1 ('MetaCons "Get" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (((->) s :: Type -> Type) :.: Rec1 m)) :+: C1 ('MetaCons "Put" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 s) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 m))) |
Instances
MonadTrans (StateC s) Source # | |
Defined in Control.Effect.State.Strict | |
Monad m => Monad (StateC s m) Source # | |
Functor m => Functor (StateC s m) Source # | |
MonadFix m => MonadFix (StateC s m) Source # | |
Defined in Control.Effect.State.Strict | |
MonadFail m => MonadFail (StateC s m) Source # | |
Defined in Control.Effect.State.Strict | |
Monad m => Applicative (StateC s m) Source # | |
Defined in Control.Effect.State.Strict | |
MonadIO m => MonadIO (StateC s m) Source # | |
Defined in Control.Effect.State.Strict | |
(Alternative m, Monad m) => Alternative (StateC s m) Source # | |
(Alternative m, Monad m) => MonadPlus (StateC s m) Source # | |
(Carrier sig m, Effect sig) => Carrier (State s :+: sig) (StateC s m) Source # | |
Instances
MonadTrans (ReaderC r) Source # | |
Defined in Control.Effect.Reader | |
Monad m => Monad (ReaderC r m) Source # | |
Functor m => Functor (ReaderC r m) Source # | |
MonadFix m => MonadFix (ReaderC s m) Source # | |
Defined in Control.Effect.Reader | |
MonadFail m => MonadFail (ReaderC r m) Source # | |
Defined in Control.Effect.Reader | |
Applicative m => Applicative (ReaderC r m) Source # | |
Defined in Control.Effect.Reader | |
MonadIO m => MonadIO (ReaderC r m) Source # | |
Defined in Control.Effect.Reader | |
Alternative m => Alternative (ReaderC r m) Source # | |
(Alternative m, Monad m) => MonadPlus (ReaderC r m) Source # | |
MonadUnliftIO m => MonadUnliftIO (ReaderC r m) Source # | |
Defined in Control.Effect.Reader askUnliftIO :: ReaderC r m (UnliftIO (ReaderC r m)) withRunInIO :: ((forall a. ReaderC r m a -> IO a) -> IO b) -> ReaderC r m b | |
Carrier sig m => Carrier (Reader r :+: sig) (ReaderC r m) Source # | |
Instances
MonadTrans ResourceC Source # | |
Defined in Control.Effect.Resource | |
Monad m => Monad (ResourceC m) Source # | |
Functor m => Functor (ResourceC m) Source # | |
MonadFix m => MonadFix (ResourceC m) Source # | |
Defined in Control.Effect.Resource | |
MonadFail m => MonadFail (ResourceC m) Source # | |
Defined in Control.Effect.Resource | |
Applicative m => Applicative (ResourceC m) Source # | |
Defined in Control.Effect.Resource | |
MonadIO m => MonadIO (ResourceC m) Source # | |
Defined in Control.Effect.Resource | |
Alternative m => Alternative (ResourceC m) Source # | |
(Alternative m, Monad m) => MonadPlus (ResourceC m) Source # | |
MonadUnliftIO m => MonadUnliftIO (ResourceC m) Source # | |
Defined in Control.Effect.Resource askUnliftIO :: ResourceC m (UnliftIO (ResourceC m)) withRunInIO :: ((forall a. ResourceC m a -> IO a) -> IO b) -> ResourceC m b | |
(Carrier sig m, MonadIO m) => Carrier (Resource :+: sig) (ResourceC m) Source # | |
Instances
A carrier for NonDet
effects based on Ralf Hinze’s design described in Deriving Backtracking Monad Transformers.
Instances
MonadTrans NonDetC Source # | |
Defined in Control.Effect.NonDet | |
Monad (NonDetC m) Source # | |
Functor (NonDetC m) Source # | |
MonadFix m => MonadFix (NonDetC m) Source # | |
Defined in Control.Effect.NonDet | |
MonadFail m => MonadFail (NonDetC m) Source # | |
Defined in Control.Effect.NonDet | |
Applicative (NonDetC m) Source # | |
MonadIO m => MonadIO (NonDetC m) Source # | |
Defined in Control.Effect.NonDet | |
Alternative (NonDetC m) Source # | |
MonadPlus (NonDetC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (NonDetC m) Source # | |
Instances
Effect NonDet Source # | |
HFunctor NonDet Source # | |
Functor m => Functor (NonDet m) Source # | |
Generic1 (NonDet m :: Type -> Type) Source # | |
(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (NonDetC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (OnceC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Cut :+: (NonDet :+: sig)) (CutC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Cull :+: (NonDet :+: sig)) (CullC m) Source # | |
type Rep1 (NonDet m :: Type -> Type) Source # | |
Defined in Control.Effect.NonDet type Rep1 (NonDet m :: Type -> Type) = D1 ('MetaData "NonDet" "Control.Effect.NonDet" "fused-effects-0.5.0.1-inplace" 'False) (C1 ('MetaCons "Empty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Choose" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (((->) Bool :: Type -> Type) :.: Rec1 m))) |
Instances
MonadTrans LiftC Source # | |
Defined in Control.Effect.Lift | |
Monad m => Monad (LiftC m) Source # | |
Functor m => Functor (LiftC m) Source # | |
MonadFix m => MonadFix (LiftC m) Source # | |
Defined in Control.Effect.Lift | |
MonadFail m => MonadFail (LiftC m) Source # | |
Defined in Control.Effect.Lift | |
Applicative m => Applicative (LiftC m) Source # | |
MonadIO m => MonadIO (LiftC m) Source # | |
Defined in Control.Effect.Lift | |
Alternative m => Alternative (LiftC m) Source # | |
MonadPlus m => MonadPlus (LiftC m) Source # | |
MonadUnliftIO m => MonadUnliftIO (LiftC m) Source # | |
Defined in Control.Effect.Lift askUnliftIO :: LiftC m (UnliftIO (LiftC m)) withRunInIO :: ((forall a. LiftC m a -> IO a) -> IO b) -> LiftC m b | |
Monad m => Carrier (Lift m) (LiftC m) Source # | |
Instances
Functor sig => Effect (Lift sig) Source # | |
Functor sig => HFunctor (Lift sig) Source # | |
Monad m => Carrier (Lift m) (LiftC m) Source # | |
Functor sig => Generic1 (Lift sig m :: Type -> Type) Source # | |
(Functor sig, Functor m) => Functor (Lift sig m) Source # | |
type Rep1 (Lift sig m :: Type -> Type) Source # | |
Defined in Control.Effect.Lift |
Instances
MonadTrans FreshC Source # | |
Defined in Control.Effect.Fresh | |
Monad m => Monad (FreshC m) Source # | |
Functor m => Functor (FreshC m) Source # | |
MonadFix m => MonadFix (FreshC m) Source # | |
Defined in Control.Effect.Fresh | |
MonadFail m => MonadFail (FreshC m) Source # | |
Defined in Control.Effect.Fresh | |
Monad m => Applicative (FreshC m) Source # | |
MonadIO m => MonadIO (FreshC m) Source # | |
Defined in Control.Effect.Fresh | |
(Alternative m, Monad m) => Alternative (FreshC m) Source # | |
(Alternative m, Monad m) => MonadPlus (FreshC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Fresh :+: sig) (FreshC m) Source # | |
Instances
MonadTrans (ErrorC e) Source # | |
Defined in Control.Effect.Error | |
Monad m => Monad (ErrorC e m) Source # | |
Functor m => Functor (ErrorC e m) Source # | |
MonadFix m => MonadFix (ErrorC e m) Source # | |
Defined in Control.Effect.Error | |
MonadFail m => MonadFail (ErrorC e m) Source # | |
Defined in Control.Effect.Error | |
Applicative m => Applicative (ErrorC e m) Source # | |
Defined in Control.Effect.Error | |
MonadIO m => MonadIO (ErrorC e m) Source # | |
Defined in Control.Effect.Error | |
Alternative m => Alternative (ErrorC e m) Source # | |
(Alternative m, Monad m) => MonadPlus (ErrorC e m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Error e :+: sig) (ErrorC e m) Source # | |
data ResumableWithC err m a Source #
Instances
data ResumableC err m a Source #
Instances
data Resumable err m k Source #
Errors which can be resumed with values of some existentially-quantified type.
Instances
Effect (Resumable err) Source # | |
HFunctor (Resumable err) Source # | |
Functor m => Functor (Resumable err m) Source # | |
Carrier sig m => Carrier (Resumable err :+: sig) (ResumableWithC err m) Source # | |
Defined in Control.Effect.Resumable eff :: (Resumable err :+: sig) (ResumableWithC err m) a -> ResumableWithC err m a Source # | |
(Carrier sig m, Effect sig) => Carrier (Resumable err :+: sig) (ResumableC err m) Source # | |
Defined in Control.Effect.Resumable eff :: (Resumable err :+: sig) (ResumableC err m) a -> ResumableC err m a Source # |
Instances
MonadTrans FailC Source # | |
Defined in Control.Effect.Fail | |
Monad m => Monad (FailC m) Source # | |
Functor m => Functor (FailC m) Source # | |
MonadFix m => MonadFix (FailC m) Source # | |
Defined in Control.Effect.Fail | |
(Carrier sig m, Effect sig) => MonadFail (FailC m) Source # | |
Defined in Control.Effect.Fail | |
Applicative m => Applicative (FailC m) Source # | |
MonadIO m => MonadIO (FailC m) Source # | |
Defined in Control.Effect.Fail | |
Alternative m => Alternative (FailC m) Source # | |
(Alternative m, Monad m) => MonadPlus (FailC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Fail :+: sig) (FailC m) Source # | |
Instances
MonadTrans CutC Source # | |
Defined in Control.Effect.Cut | |
Monad (CutC m) Source # | |
Functor (CutC m) Source # | |
MonadFix m => MonadFix (CutC m) Source # | |
Defined in Control.Effect.Cut | |
MonadFail m => MonadFail (CutC m) Source # | |
Defined in Control.Effect.Cut | |
Applicative (CutC m) Source # | |
MonadIO m => MonadIO (CutC m) Source # | |
Defined in Control.Effect.Cut | |
Alternative (CutC m) Source # | |
MonadPlus (CutC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Cut :+: (NonDet :+: sig)) (CutC m) Source # | |
Instances
Monad (OnceC m) Source # | |
Functor (OnceC m) Source # | |
MonadFix m => MonadFix (OnceC m) Source # | |
Defined in Control.Effect.Cull | |
MonadFail m => MonadFail (OnceC m) Source # | |
Defined in Control.Effect.Cull | |
Applicative (OnceC m) Source # | |
MonadIO m => MonadIO (OnceC m) Source # | |
Defined in Control.Effect.Cull | |
Alternative (OnceC m) Source # | |
MonadPlus (OnceC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (NonDet :+: sig) (OnceC m) Source # | |
Instances
MonadTrans CullC Source # | |
Defined in Control.Effect.Cull | |
Monad (CullC m) Source # | |
Functor (CullC m) Source # | |
MonadFix m => MonadFix (CullC m) Source # | |
Defined in Control.Effect.Cull | |
MonadFail m => MonadFail (CullC m) Source # | |
Defined in Control.Effect.Cull | |
Applicative (CullC m) Source # | |
MonadIO m => MonadIO (CullC m) Source # | |
Defined in Control.Effect.Cull | |
Alternative (CullC m) Source # | |
MonadPlus (CullC m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Cull :+: (NonDet :+: sig)) (CullC m) Source # | |
data TraceByReturningC m a Source #
Instances
data TraceByIgnoringC m a Source #
Instances
data TraceByPrintingC m a Source #
Instances
Instances
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 # | |
Defined in Control.Effect.Writer | |
Monad m => Monad (WriterC w m) Source # | |
Functor m => Functor (WriterC w m) Source # | |
MonadFix m => MonadFix (WriterC w m) Source # | |
Defined in Control.Effect.Writer | |
MonadFail m => MonadFail (WriterC w m) Source # | |
Defined in Control.Effect.Writer | |
Monad m => Applicative (WriterC w m) Source # | |
Defined in Control.Effect.Writer | |
MonadIO m => MonadIO (WriterC w m) Source # | |
Defined in Control.Effect.Writer | |
(Alternative m, Monad m) => Alternative (WriterC w m) Source # | |
(Alternative m, Monad m) => MonadPlus (WriterC w m) Source # | |
(Monoid w, Carrier sig m, Effect sig) => Carrier (Writer w :+: sig) (WriterC w m) Source # | |