Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Trace :: Effect 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 o. Monoid o => Threads (WriterT o) p) => WriterThreads p
- data TraceListC m a
- type TracePrintingC = InterpretC TracePrintingH Trace
- type IgnoreTraceC = InterpretC IgnoreTraceH Trace
- type TraceIntoTellC = ReinterpretC TraceToTellH Trace '[Tell String]
Effects
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 trace
d 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 trace
d 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 trace
d 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 trace
d 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 o. Monoid o => Threads (WriterT o) p) => WriterThreads p Source #
WriterThreads
accepts the following primitive effects:
Regional
s
Optional
s
(whens
is a functor)BaseControl
b
ListenPrim
o
(wheno
is aMonoid
)WriterPrim
o
(wheno
is aMonoid
)ReaderPrim
i
Mask
Bracket
Fix
Split
Instances
(forall o. Monoid o => Threads (WriterT o) p) => WriterThreads p Source # | |
Defined in Control.Effect.Internal.Writer |
Carriers
data TraceListC m a Source #
Instances
type TracePrintingC = InterpretC TracePrintingH Trace Source #
type IgnoreTraceC = InterpretC IgnoreTraceH Trace Source #
type TraceIntoTellC = ReinterpretC TraceToTellH Trace '[Tell String] Source #