Data.Bool

base-4.6.0.1: Basic libraries

Portability | portable
Stability | experimental
Maintainer | libraries@haskell.org
Safe Haskell | Trustworthy

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 |
Generic Bool |
Storable Bool |

## Operations

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

Boolean "and"

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

Boolean "or"

not :: Bool -> Bool Source

Boolean "not"

otherwise :: Bool

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

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