base-4.3.1.0: Basic libraries

Portability | portable
Stability | experimental
Maintainer | libraries@haskell.org

Data.Bool

Contents

- Booleans
  - Operations

Description

The `Bool` type and related functions.

Synopsis

- data Bool
  - = False
  - | True
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- otherwise :: Bool

# Booleans

data Bool Source

Constructors

False |
True |

Instances

Bounded Bool |
Enum Bool |
Eq Bool |
Data Bool |
Ord Bool |
Read Bool |
Show Bool |
Ix Bool |
Typeable Bool |
Storable Bool |

## Operations

(&&) :: Bool -> Bool -> Bool

Boolean "and"

(||) :: Bool -> Bool -> Bool

Boolean "or"

not :: Bool -> Bool

Boolean "not"

otherwise :: Bool

`otherwise` is defined as the value `True`. It helps to make guards more readable. eg.

      f x | x < 0     = ...
          | otherwise = ...