when package:verset

Conditional execution of Applicative expressions. For example,

Examples

when debug (putStrLn "Debugging")
will output the string Debugging if the Boolean value debug is True, and otherwise do nothing.
>>> putStr "pi:" >> when False (print 3.14159)
pi:
Like when, but where the test can be monadic.