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

Safe HaskellNone
LanguageHaskell2010

Control.Effect.Trace

Synopsis

Documentation

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

Constructors

Trace 

Fields

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

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

Append a message to the trace log.

runTraceByPrinting :: (MonadIO m, Carrier sig m) => Eff (TraceByPrintingC m) a -> m a Source #

Run a Trace effect, printing traces to stderr.

newtype TraceByPrintingC m a Source #

Constructors

TraceByPrintingC 

Fields

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

Defined in Control.Effect.Trace

runTraceByIgnoring :: Carrier sig m => Eff (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
Carrier sig m => Carrier (Trace :+: sig) (TraceByIgnoringC m) Source # 
Instance details

Defined in Control.Effect.Trace

runTraceByReturning :: (Carrier sig m, Effect sig, Functor m) => Eff (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 

Fields

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

Defined in Control.Effect.Trace