when package:distribution-opensuse

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.
Perform some operation on Just, given the field inside the Just. This is a specialized for_.
whenJust Nothing  print == pure ()
whenJust (Just 1) print == print 1
Like whenJust, but where the test can be monadic.
Like when, but where the test can be monadic.
Like when, but return either Nothing if the predicate was False, of Just with the result of the computation.
whenMaybe True  (print 1) == fmap Just (print 1)
whenMaybe False (print 1) == pure Nothing
Like whenMaybe, but where the test can be monadic.