haskell2010-base
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Bool

Description

 
Synopsis

Documentation

data Bool #

Constructors

False 
True 

Instances

Instances details
Eq Bool # 
Instance details

Defined in Data.Eq

Methods

(==) :: Bool -> Bool -> Bool #

(/=) :: Bool -> Bool -> Bool #

Ix Bool # 
Instance details

Defined in Data.Ix

Methods

range :: (Bool, Bool) -> [Bool] #

index :: (Bool, Bool) -> Bool -> Int #

inRange :: (Bool, Bool) -> Bool -> Bool #

rangeSize :: (Bool, Bool) -> Int #

Ord Bool # 
Instance details

Defined in Data.Ord

Methods

compare :: Bool -> Bool -> Ordering #

(<) :: Bool -> Bool -> Bool #

(<=) :: Bool -> Bool -> Bool #

(>=) :: Bool -> Bool -> Bool #

(>) :: Bool -> Bool -> Bool #

max :: Bool -> Bool -> Bool #

min :: Bool -> Bool -> Bool #

Storable Bool # 
Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Bool -> Int #

alignment :: Bool -> Int #

peekElemOff :: Ptr Bool -> Int -> IO Bool #

pokeElemOff :: Ptr Bool -> Int -> Bool -> IO () #

peekByteOff :: Ptr b -> Int -> IO Bool #

pokeByteOff :: Ptr b -> Int -> Bool -> IO () #

peek :: Ptr Bool -> IO Bool #

poke :: Ptr Bool -> Bool -> IO () #

(&&) :: Bool -> Bool -> Bool infixr 3 #

Boolean "and", lazy in the second argument

Specification:

Expand
True && x = x
False && _ = False

(||) :: Bool -> Bool -> Bool infixr 2 #

Boolean "or", lazy in the second argument

Specification:

Expand
True || _ = True
False || x = x

not :: Bool -> Bool #

Boolean "not"

Specification:

Expand
not True = False
not False = True

otherwise :: Bool #

otherwise is defined as the value True. It helps to make guards more readable, e.g.

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

Specification:

Expand
otherwise = True