when package:termonad

Conditional execution of Applicative expressions. For example,
when debug (putStrLn "Debugging")
will output the string Debugging if the Boolean value debug is True, and otherwise do nothing.
Run a function over the value contained in an Option. Return mempty when Option is Unset.
>>> whenSet (Set [1,2,3]) (++ [4,5,6]) :: [Int]
[1,2,3,4,5,6]

>>> whenSet Unset (++ [4,5,6]) :: [Int]
[]