Data.Bool
v11.3.15 • Boolean Logic
Boolean operations and Church-encoded logic.
Types
Bool :: *
Boolean type representing truth values (True and False).
Implementationdata Bool = False | True
Foreigns
No foreign functions defined in this module.
Functions
not :: Bool -> Bool
Standard boolean negation.
Implementationnot b = case b of
True -> False
False -> True
and :: Bool -> Bool -> Bool
Boolean conjunction.
Implementationand a b = case a of
True -> b
False -> False
or :: Bool -> Bool -> Bool
Boolean disjunction.
Implementationor a b = case a of
True -> True
False -> b
bool_if :: Bool -> A -> A -> A
Functional version of if-then-else.
Implementationbool_if b t f = case b of
True -> t
False -> f