polysemy-1.6.0.0: Higher-order, low-boilerplate free monads.
Safe HaskellNone
LanguageHaskell2010

Polysemy.Trace

Synopsis

Effect

data Trace m a where Source #

An effect for logging strings.

Constructors

Trace :: String -> Trace m () 

Instances

Instances details
type DefiningModule (Trace :: k -> Type -> Type) Source # 
Instance details

Defined in Polysemy.Trace

type DefiningModule (Trace :: k -> Type -> Type) = "Polysemy.Trace"

Actions

trace :: forall r. MemberWithError Trace r => String -> Sem r () Source #

Interpretations

traceToHandle :: Member (Embed IO) r => Handle -> Sem (Trace ': r) a -> Sem r a Source #

Run a Trace effect by printing the messages to the provided Handle.

Since: 1.6.0.0

traceToStdout :: Member (Embed IO) r => Sem (Trace ': r) a -> Sem r a Source #

Run a Trace effect by printing the messages to stdout.

Since: 1.6.0.0

traceToStderr :: Member (Embed IO) r => Sem (Trace ': r) a -> Sem r a Source #

Run a Trace effect by printing the messages to stderr.

Since: 1.6.0.0

traceToIO :: Member (Embed IO) r => Sem (Trace ': r) a -> Sem r a Source #

Deprecated: Use traceToStdout

Run a Trace effect by printing the messages to stdout.

Since: 1.0.0.0

runTraceList :: Sem (Trace ': r) a -> Sem r ([String], a) Source #

Get the result of a Trace effect as a list of Strings.

Since: 1.0.0.0

ignoreTrace :: Sem (Trace ': r) a -> Sem r a Source #

Run a Trace effect by ignoring all of its messages.

Since: 1.0.0.0

traceToOutput :: Member (Output String) r => Sem (Trace ': r) a -> Sem r a Source #

Transform a Trace effect into a Output String effect.

Since: 1.0.0.0

Interpretations for Other Effects

outputToTrace :: forall w r a. Member Trace r => (w -> String) -> Sem (Output w ': r) a -> Sem r a Source #

Transform an Output w effect into a Trace effect given a function to transform each w to a String.

Since: 1.0.0.0