Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Trace (m :: * -> *) k = Trace {
- traceMessage :: String
- traceCont :: k
- trace :: (Member Trace sig, Carrier sig m) => String -> m ()
- runTraceByPrinting :: (MonadIO m, Carrier sig m) => Eff (TraceByPrintingC m) a -> m a
- newtype TraceByPrintingC m a = TraceByPrintingC {
- runTraceByPrintingC :: m a
- runTraceByIgnoring :: Carrier sig m => Eff (TraceByIgnoringC m) a -> m a
- newtype TraceByIgnoringC m a = TraceByIgnoringC {
- runTraceByIgnoringC :: m a
- runTraceByReturning :: (Carrier sig m, Effect sig, Functor m) => Eff (TraceByReturningC m) a -> m ([String], a)
- newtype TraceByReturningC m a = TraceByReturningC {
- runTraceByReturningC :: [String] -> m ([String], a)
Documentation
data Trace (m :: * -> *) k Source #
Trace | |
|
Instances
Effect Trace Source # | |
HFunctor Trace Source # | |
Functor (Trace m) Source # | |
(Carrier sig m, Effect sig) => Carrier (Trace :+: sig) (TraceByReturningC m) Source # | |
Defined in Control.Effect.Trace ret :: a -> TraceByReturningC m a Source # eff :: (Trace :+: sig) (TraceByReturningC m) (TraceByReturningC m a) -> TraceByReturningC m a Source # | |
Carrier sig m => Carrier (Trace :+: sig) (TraceByIgnoringC m) Source # | |
Defined in Control.Effect.Trace ret :: a -> TraceByIgnoringC m a Source # eff :: (Trace :+: sig) (TraceByIgnoringC m) (TraceByIgnoringC m a) -> TraceByIgnoringC m a Source # | |
(MonadIO m, Carrier sig m) => Carrier (Trace :+: sig) (TraceByPrintingC m) Source # | |
Defined in Control.Effect.Trace ret :: a -> TraceByPrintingC m a Source # eff :: (Trace :+: sig) (TraceByPrintingC m) (TraceByPrintingC m a) -> TraceByPrintingC m a Source # |
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 #
newtype TraceByPrintingC m a Source #
Instances
(MonadIO m, Carrier sig m) => Carrier (Trace :+: sig) (TraceByPrintingC m) Source # | |
Defined in Control.Effect.Trace ret :: a -> TraceByPrintingC m a Source # eff :: (Trace :+: sig) (TraceByPrintingC m) (TraceByPrintingC m a) -> TraceByPrintingC m a Source # |
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 #
Instances
Carrier sig m => Carrier (Trace :+: sig) (TraceByIgnoringC m) Source # | |
Defined in Control.Effect.Trace ret :: a -> TraceByIgnoringC m a Source # eff :: (Trace :+: sig) (TraceByIgnoringC m) (TraceByIgnoringC m a) -> TraceByIgnoringC m a Source # |
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 #
TraceByReturningC | |
|
Instances
(Carrier sig m, Effect sig) => Carrier (Trace :+: sig) (TraceByReturningC m) Source # | |
Defined in Control.Effect.Trace ret :: a -> TraceByReturningC m a Source # eff :: (Trace :+: sig) (TraceByReturningC m) (TraceByReturningC m a) -> TraceByReturningC m a Source # |