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

Control.Effect.Trace

Synopsis

Trace effect

data Trace m k Source #

Constructors

Trace 

Fields

Instances

Instances details
Effect Trace Source # 
Instance details

Defined in Control.Effect.Trace

Methods

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

HFunctor Trace Source # 
Instance details

Defined in Control.Effect.Trace

Methods

fmap' :: forall (f :: Type -> Type) a b. Functor (Trace f) => (a -> b) -> Trace f a -> Trace f b Source #

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

Functor m => 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 #

Generic1 (Trace m :: Type -> Type) Source # 
Instance details

Defined in Control.Effect.Trace

Associated Types

type Rep1 (Trace m) :: k -> Type #

Methods

from1 :: forall (a :: k). Trace m a -> Rep1 (Trace m) a #

to1 :: forall (a :: k). Rep1 (Trace m) a -> Trace m a #

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

Defined in Control.Effect.Trace

Methods

eff :: (Trace :+: sig) (TraceByReturningC m) a -> TraceByReturningC m a Source #

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

Defined in Control.Effect.Trace

Methods

eff :: (Trace :+: sig) (TraceByIgnoringC m) a -> TraceByIgnoringC m a Source #

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

Defined in Control.Effect.Trace

Methods

eff :: (Trace :+: sig) (TraceByPrintingC m) a -> TraceByPrintingC m a Source #

type Rep1 (Trace m :: Type -> Type) Source # 
Instance details

Defined in Control.Effect.Trace

type Rep1 (Trace m :: Type -> Type) = D1 ('MetaData "Trace" "Control.Effect.Trace" "fused-effects-0.5.0.1-inplace" 'False) (C1 ('MetaCons "Trace" 'PrefixI 'True) (S1 ('MetaSel ('Just "traceMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "traceCont") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 m)))

trace :: (Member Trace sig, Carrier sig m) => String -> m () Source #

Append a message to the trace log.

Trace carriers

runTraceByPrinting :: TraceByPrintingC m a -> m a Source #

Run a Trace effect, printing traces to stderr.

newtype TraceByPrintingC m a Source #

Constructors

TraceByPrintingC 

Fields

Instances

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

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

Defined in Control.Effect.Trace

Methods

mfix :: (a -> TraceByPrintingC m a) -> 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

Methods

eff :: (Trace :+: sig) (TraceByPrintingC m) a -> TraceByPrintingC m a Source #

runTraceByIgnoring :: TraceByIgnoringC m a -> m a Source #

Run a Trace effect, ignoring all traces.

run (runTraceByIgnoring (trace a *> pure b)) === b

newtype TraceByIgnoringC m a Source #

Constructors

TraceByIgnoringC 

Fields

Instances

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

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

Defined in Control.Effect.Trace

Methods

mfix :: (a -> TraceByIgnoringC m a) -> 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

Methods

eff :: (Trace :+: sig) (TraceByIgnoringC m) a -> TraceByIgnoringC m a Source #

runTraceByReturning :: Functor m => TraceByReturningC m a -> m ([String], a) Source #

Run a Trace effect, returning all traces as a list.

run (runTraceByReturning (trace a *> trace b *> pure c)) === ([a, b], c)

newtype TraceByReturningC m a Source #

Constructors

TraceByReturningC 

Instances

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

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

Defined in Control.Effect.Trace

Methods

mfix :: (a -> TraceByReturningC m a) -> 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

Methods

eff :: (Trace :+: sig) (TraceByReturningC m) a -> TraceByReturningC m a Source #

Re-exports

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

Instances details
Carrier Pure PureC Source # 
Instance details

Defined in Control.Effect.Carrier

Methods

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

(HFunctor eff, Carrier sig m, Member eff sig) => Carrier sig (InterposeC eff m) Source # 
Instance details

Defined in Control.Effect.Interpose

Methods

eff :: sig (InterposeC eff m) a -> InterposeC eff m a Source #

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

Defined in Control.Effect.Lift

Methods

eff :: Lift m (LiftC m) 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) 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) 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) 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) 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) 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) 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) a -> CullC m a Source #

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

Defined in Control.Effect.Trace

Methods

eff :: (Trace :+: sig) (TraceByReturningC m) a -> TraceByReturningC m a Source #

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

Defined in Control.Effect.Trace

Methods

eff :: (Trace :+: sig) (TraceByIgnoringC m) a -> TraceByIgnoringC m a Source #

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

Defined in Control.Effect.Trace

Methods

eff :: (Trace :+: sig) (TraceByPrintingC m) a -> TraceByPrintingC m a Source #

(HFunctor eff, Carrier sig m) => Carrier (eff :+: sig) (InterpretC eff m) Source # 
Instance details

Defined in Control.Effect.Interpret

Methods

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

Defined in Control.Effect.State.Strict

Methods

eff :: (State s :+: sig) (StateC s m) 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) 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) 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) 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) 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) 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) 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) a -> WriterC w m a Source #

(HFunctor eff, Carrier sig m, Effect sig) => Carrier (eff :+: sig) (InterpretStateC eff s m) Source # 
Instance details

Defined in Control.Effect.Interpret

Methods

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

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

Minimal complete definition

inj, prj

Instances

Instances details
Member sub sub Source # 
Instance details

Defined in Control.Effect.Sum

Methods

inj :: forall (m :: Type -> Type) a. sub m a -> sub m a Source #

prj :: forall (m :: Type -> Type) a. 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 :: forall (m :: Type -> Type) a. sub m a -> (sub' :+: sup) m a Source #

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

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

Defined in Control.Effect.Sum

Methods

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

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

run :: PureC a -> a Source #

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