linear-base-0.4.0: Standard library for linear types.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Bool.Linear

Description

This module provides linear functions on the standard Bool type.

Synopsis

The Boolean type

data Bool #

Constructors

False 
True 

Instances

Instances details
Storable Bool

Since: base-2.1

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 () #

Bounded Bool

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Bool

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: Bool -> Bool #

pred :: Bool -> Bool #

toEnum :: Int -> Bool #

fromEnum :: Bool -> Int #

enumFrom :: Bool -> [Bool] #

enumFromThen :: Bool -> Bool -> [Bool] #

enumFromTo :: Bool -> Bool -> [Bool] #

enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] #

Generic Bool 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Bool :: Type -> Type #

Methods

from :: Bool -> Rep Bool x #

to :: Rep Bool x -> Bool #

SingKind Bool

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type DemoteRep Bool

Methods

fromSing :: forall (a :: Bool). Sing a -> DemoteRep Bool

Ix Bool

Since: base-2.1

Instance details

Defined in GHC.Ix

Methods

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

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

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

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

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

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

Read Bool

Since: base-2.1

Instance details

Defined in GHC.Read

Show Bool

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Bool -> ShowS #

show :: Bool -> String #

showList :: [Bool] -> ShowS #

Eq Bool 
Instance details

Defined in GHC.Classes

Methods

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

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

Ord Bool 
Instance details

Defined in GHC.Classes

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 #

Hashable Bool 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Bool -> Int #

hash :: Bool -> Int #

Eq Bool Source # 
Instance details

Defined in Data.Ord.Linear.Internal.Eq

Methods

(==) :: Bool %1 -> Bool %1 -> Bool Source #

(/=) :: Bool %1 -> Bool %1 -> Bool Source #

Ord Bool Source # 
Instance details

Defined in Data.Ord.Linear.Internal.Ord

Methods

compare :: Bool %1 -> Bool %1 -> Ordering Source #

(<=) :: Bool %1 -> Bool %1 -> Bool Source #

(<) :: Bool %1 -> Bool %1 -> Bool Source #

(>) :: Bool %1 -> Bool %1 -> Bool Source #

(>=) :: Bool %1 -> Bool %1 -> Bool Source #

Consumable Bool Source # 
Instance details

Defined in Data.Unrestricted.Linear.Internal.Consumable

Methods

consume :: Bool %1 -> () Source #

Dupable Bool Source # 
Instance details

Defined in Data.Unrestricted.Linear.Internal.Dupable

Methods

dupR :: Bool %1 -> Replicator Bool Source #

dup2 :: Bool %1 -> (Bool, Bool) Source #

Movable Bool Source # 
Instance details

Defined in Data.Unrestricted.Linear.Internal.Movable

Methods

move :: Bool %1 -> Ur Bool Source #

Uniform Bool 
Instance details

Defined in System.Random.Internal

Methods

uniformM :: StatefulGen g m => g -> m Bool #

UniformRange Bool 
Instance details

Defined in System.Random.Internal

Methods

uniformRM :: StatefulGen g m => (Bool, Bool) -> g -> m Bool #

SingI 'False

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing 'False

SingI 'True

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing 'True

Lift Bool 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Bool -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Bool -> Code m Bool #

type DemoteRep Bool 
Instance details

Defined in GHC.Generics

type DemoteRep Bool = Bool
type Rep Bool

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep Bool = D1 ('MetaData "Bool" "GHC.Types" "ghc-prim" 'False) (C1 ('MetaCons "False" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "True" 'PrefixI 'False) (U1 :: Type -> Type))
data Sing (a :: Bool) 
Instance details

Defined in GHC.Generics

data Sing (a :: Bool) where
type Rep Bool 
Instance details

Defined in Generics.Linear.Instances.Base

type Rep Bool = D1 ('MetaData "Bool" "GHC.Types" "ghc-prim" 'False) (C1 ('MetaCons "False" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "True" 'PrefixI 'False) (U1 :: Type -> Type))

Operators

(&&) :: Bool %1 -> Bool %1 -> Bool infixr 3 Source #

True iff both are True. NOTE: this is strict and not lazy!

(||) :: Bool %1 -> Bool %1 -> Bool infixr 2 Source #

True iff either is True NOTE: this is strict and not lazy!

not :: Bool %1 -> Bool Source #

not b is True iff b is False NOTE: this is strict and not lazy!

otherwise :: Bool #

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

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