unless is:exact

The reverse of when.

Examples

>>> do x <- getLine
unless (x == "hi") (putStrLn "hi!")
comingupwithexamplesisdifficult
hi!
>>> unless (pi > exp 1) Nothing
Just ()
The reverse of when.
Generalization of unless
When the given predicate is false for the input signal.
  • Depends: now.
  • Inhibits: unless the predicate is false.
Generalization of unless.