polysemy-0.1.1.0: Higher-order, low-boilerplate, zero-cost free monads.

Safe HaskellNone
LanguageHaskell2010

Polysemy.Trace

Contents

Synopsis

Effect

data Trace m a where Source #

An effect for logging strings.

Constructors

Trace :: String -> Trace m () 
Instances
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. Member Trace r => String -> Semantic r () Source #

Interpretations

runTraceIO :: Member (Lift IO) r => Semantic (Trace ': r) a -> Semantic r a Source #

Run a Trace effect by printing the messages to stdout.

runIgnoringTrace :: Member (Lift IO) r => Semantic (Trace ': r) a -> Semantic r a Source #

Run a Trace effect by ignoring all of its messages.

runTraceAsOutput :: Semantic (Trace ': r) a -> Semantic (Output String ': r) a Source #

Transform a Trace effect into a Output String effect.