query
On this page

traceIf

lib.traceIf

Docs pulled from | This Revision | 21 minutes 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
(lib.debug.traceIf)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

traceIf =
    pred:
    msg:
    x: if pred then trace msg x else x;