query
On this page

warnIf

lib.warnIf

Docs pulled from | This Revision | 8 minutes ago


warnIf condition message value

Like warn, but only warn when the first argument is true.

Inputs

condition (Boolean)

true to trigger the warning before continuing with value.

message (String)

Warning message to print before evaluating

value (any value)

Value to return as-is.

Type

Bool -> String -> a -> a
(lib.trivial.warnIf)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

warnIf = cond: msg: if cond then warn msg else x: x;