| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Effect.Trace
Synopsis
- data Trace m a where
- trace :: Eff Trace m => String -> m ()
- traceShow :: (Show a, Eff Trace m) => a -> m ()
- runTraceList :: forall m a p. (Threaders '[WriterThreads] m p, Carrier m) => TraceListC m a -> m ([String], a)
- runTraceListIO :: Eff (Embed IO) m => InterpretReifiedC Trace m a -> m ([String], a)
- runTracePrinting :: Eff (Embed IO) m => TracePrintingC m a -> m a
- runTraceToHandle :: Eff (Embed IO) m => Handle -> InterpretReifiedC Trace m a -> m a
- ignoreTrace :: Carrier m => IgnoreTraceC m a -> m a
- traceIntoTell :: HeadEff (Tell String) m => TraceIntoTellC m a -> m a
- runTraceListIOSimple :: forall m a p. (Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => InterpretSimpleC Trace m a -> m ([String], a)
- runTraceToHandleSimple :: forall m a p. (Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => Handle -> InterpretSimpleC Trace m a -> m a
- class (forall s. Monoid s => Threads (WriterT s) p) => WriterThreads p
- type TraceListC = CompositionC '[TraceIntoTellC, TellListC String]
- type TracePrintingC = InterpretC TracePrintingH Trace
- type IgnoreTraceC = InterpretC IgnoreTraceH Trace
- type TraceIntoTellC = ReinterpretC TraceToTellH Trace '[Tell String]
Effects
An effect for debugging by printing/logging strings.
Actions
Interpretations
runTraceList :: forall m a p. (Threaders '[WriterThreads] m p, Carrier m) => TraceListC m a -> m ([String], a) Source #
runTraceListIO :: Eff (Embed IO) m => InterpretReifiedC Trace m a -> m ([String], a) Source #
Run a Trace effect by accumulating all traced strings
into a list using atomic operations in IO.
This has a higher-rank type, as it makes use of InterpretReifiedC.
This makes runTraceListIO very difficult to use partially applied.
In particular, it can't be composed using ..
If performance is secondary, consider using the slower runTraceListIOSimple,
which doesn't have a higher-rank type.
runTracePrinting :: Eff (Embed IO) m => TracePrintingC m a -> m a Source #
runTraceToHandle :: Eff (Embed IO) m => Handle -> InterpretReifiedC Trace m a -> m a Source #
Run Trace effect by providing each traced string
to the provided Handle.
This has a higher-rank type, as it makes use of InterpretReifiedC.
This makes runTraceToHandle very difficult to use partially applied.
In particular, it can't be composed using ..
If performance is secondary, consider using the slower runTraceToHandleSimple,
which doesn't have a higher-rank type.
ignoreTrace :: Carrier m => IgnoreTraceC m a -> m a Source #
Run a Trace effect by ignoring it, doing no logging at all.
traceIntoTell :: HeadEff (Tell String) m => TraceIntoTellC m a -> m a Source #
Simple variants of interprations
runTraceListIOSimple :: forall m a p. (Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => InterpretSimpleC Trace m a -> m ([String], a) Source #
Run a Trace effect by accumulating all traced strings
into a list using atomic operations in IO.
This is a less performant version of runTraceListIOSimple that doesn't have
a higher-rank type, making it much easier to use partially applied.
runTraceToHandleSimple :: forall m a p. (Eff (Embed IO) m, Threaders '[ReaderThreads] m p) => Handle -> InterpretSimpleC Trace m a -> m a Source #
Run Trace effect by providing each traced string
to the provided Handle.
This is a less performant version of runTraceToHandle that doesn't have
a higher-rank type, making it much easier to use partially applied.
Threading constraints
class (forall s. Monoid s => Threads (WriterT s) p) => WriterThreads p Source #
WriterThreads accepts the following primitive effects:
RegionalsOptionals(whensis a functor)BaseControlbListenPrims(whensis aMonoid)WriterPrims(whensis aMonoid)ReaderPrimiMaskBracketFixSplit
Instances
| (forall s. Monoid s => Threads (WriterT s) p) => WriterThreads p Source # | |
Defined in Control.Effect.Internal.Writer | |
Carriers
type TraceListC = CompositionC '[TraceIntoTellC, TellListC String] Source #
type TracePrintingC = InterpretC TracePrintingH Trace Source #
type IgnoreTraceC = InterpretC IgnoreTraceH Trace Source #
type TraceIntoTellC = ReinterpretC TraceToTellH Trace '[Tell String] Source #