traceIf
lib.debug.traceIf
Docs pulled from | This Revision | 4 days ago
Conditionally trace the supplied message, based on a predicate.
Inputs
pred-
Predicate to check
msg-
Message that should be traced
x-
Value to return
Type
traceIf :: bool -> string -> a -> a
Examples
lib.debug.traceIf usage example
traceIf true "hello" 3
trace: hello
=> 3
Noogle detected
Implementation
The following is the current implementation of this function.
traceIf =
pred: msg: x:
if pred then trace msg x else x;