trace-embrace
Safe HaskellNone
LanguageGHC2024

Debug.TraceEmbrace

Description

The root module to be imported by applications and libraries.

Synopsis

Documentation

newtype ShowTrace a Source #

Wrap value which has opaque Show instance.

Constructors

ShowTrace 

Fields

Instances

Instances details
Show (ShowTrace ByteString) Source # 
Instance details

Defined in Debug.TraceEmbrace.ByteString

Show (ShowTrace ByteString) Source # 
Instance details

Defined in Debug.TraceEmbrace.ByteString

Show (ShowTrace a) => Show (ShowTrace (Tagged t a)) Source # 
Instance details

Defined in Debug.TraceEmbrace.ByteString

Methods

showsPrec :: Int -> ShowTrace (Tagged t a) -> ShowS #

show :: ShowTrace (Tagged t a) -> String #

showList :: [ShowTrace (Tagged t a)] -> ShowS #

Show (ShowTrace a) => Show (ShowTrace (Maybe a)) Source # 
Instance details

Defined in Debug.TraceEmbrace.ByteString

Show (ShowTrace a) => Show (ShowTrace [Tagged t a]) Source # 
Instance details

Defined in Debug.TraceEmbrace.ByteString

Methods

showsPrec :: Int -> ShowTrace [Tagged t a] -> ShowS #

show :: ShowTrace [Tagged t a] -> String #

showList :: [ShowTrace [Tagged t a]] -> ShowS #

Show (ShowTrace a) => Show (ShowTrace [a]) Source # 
Instance details

Defined in Debug.TraceEmbrace.ByteString

Methods

showsPrec :: Int -> ShowTrace [a] -> ShowS #

show :: ShowTrace [a] -> String #

showList :: [ShowTrace [a]] -> ShowS #

a :: Q Pat Source #

Generates consequent pattern variable for tracing arguments of a guarded function. It is assumed that a is used together with tg and u.

foo $a $a $a | $tg = $u
foo 0  _  _ = 0
foo x y z = x + y + z

s_ :: Q Pat Source #

Similar to a, but argument is not included in trace message.

tg :: Q Exp Source #

Expands to $(tr "/a b c d...") False

tg' :: String -> Q Exp Source #

Similar to tg with message prefix with the argument.

tr :: String -> Q Exp Source #

TH version of trace and traceEvent The message is formatted according to TraceMessageFormat. The generated expression has type forall r (a :: TYPE r) b a. Rewrap a b => a -> a. id is generated if effective trace level is lower than trace level threshold. Example:

foo x = $(tr "get/x") x

Output:

Module::foo get; x : 132

trFunMarker :: Q Exp Source #

TH version of traceMarker where module and function are used as a marker. Trace level is used.

trIo :: String -> Q Exp Source #

TH version of traceIO and traceEventIO The message is formatted according to TraceMessageFormat. Example:

foo x = $(trIo "get/x") >> pure x

Output:

Module::foo get; x : 132

trIoFunMarker :: Q Exp Source #

TH version of traceMarkerIO where module and function are used as a marker. Trace level is not used.

tw :: String -> Q Exp Source #

TH version of traceWith and traceEventWith The message is formatted according to TraceMessageFormat. The generated expression has type forall r (a :: TYPE r) b a. (Show a, Rewrap a b) => a -> a. id is generated if effective trace level is lower than trace level threshold. Example:

foo x = $(tw "get/x") (x + 1)

Output:

Module::foo get; x : 132 => 133

tw' :: String -> Q Exp Source #

Like tw but return value is wrapped with ShowTrace.

u :: Q Exp Source #

Shortcut for undefined

underbar :: Undebar Source #