type-level-numbers-0.1.1.0: Type level numbers implemented using type families.

Safe HaskellSafe-Inferred
LanguageHaskell98

TypeLevel.Boolean

Contents

Synopsis

Documentation

data True Source

Data type for truth

Instances

Show True 
Reify True Bool 
type Not True = False 
type Xor False True = True 
type Xor True False = True 
type Xor True True = False 
type Or False True = True 
type Or True False = True 
type Or True True = False 
type And False True = False 
type And True False = False 
type And True True = True 

data False Source

Data type for false.

Instances

Show False 
Reify False Bool 
type Not False = True 
type Xor False False = False 
type Xor False True = True 
type Xor True False = True 
type Or False False = True 
type Or False True = True 
type Or True False = True 
type And False False = False 
type And False True = False 
type And True False = False 

Boolean operations

type family Not a :: * Source

Negation

Instances

type Not False = True 
type Not True = False 

notT :: a -> Not a Source

type family And a b :: * Source

And for boolean types

Instances

type And False False = False 
type And False True = False 
type And True False = False 
type And True True = True 

andT :: a -> b -> And a b Source

type family Or a b :: * Source

Or for boolean types

Instances

type Or False False = True 
type Or False True = True 
type Or True False = True 
type Or True True = False 

orT :: a -> b -> Or a b Source

type family Xor a b :: * Source

Exlusive or for boolean types

Instances

type Xor False False = False 
type Xor False True = True 
type Xor True False = True 
type Xor True True = False 

xorT :: a -> b -> Xor a b Source