fused-effects-0.3.1.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 :: TraceByPrintingC m a -> m a Source #

Run a Trace effect, printing traces to stderr.

newtype TraceByPrintingC m a Source #

Constructors

TraceByPrintingC 

Fields

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

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
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

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
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