unless package:relude

The reverse of when.

Examples

>>> do x <- getLine
unless (x == "hi") (putStrLn "hi!")
comingupwithexamplesisdifficult
hi!
>>> unless (pi > exp 1) Nothing
Just ()
Monadic version of unless. Reverse of whenM. Conditionally don't execute the provided action.
>>> unlessM (pure False) $ putTextLn "No text :("
No text :(

>>> unlessM (pure True) $ putTextLn "Yes text :)"