| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.Bool.Compat
Documentation
module Data.Bool
Case analysis for the Bool type. evaluates to bool f t pf
when p is False, and evaluates to t when p is True.
This is equivalent to if p then t else f; that is, one can
think of it as an if-then-else construct with its arguments
reordered.
@since base-4.7.0.0
Examples
Basic usage:
>>>bool "foo" "bar" True"bar">>>bool "foo" "bar" False"foo"
Confirm that and bool f t pif p then t else f are
equivalent:
>>>let p = True; f = "bar"; t = "foo">>>bool f t p == if p then t else fTrue>>>let p = False>>>bool f t p == if p then t else fTrue