type-level-0.3.0: Type-level programming library

Copyright(c) 2008 Alfonso Acosta, Oleg Kiselyov, Wolfgang Jeltsch and KTH's SAM group
LicenseBSD-style (see the file LICENSE)
Maintaineralfonso.acosta@gmail.com
Stabilityexperimental (MPTC, non-standarad instances)
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

Data.TypeLevel.Bool

Contents

Description

Type-level Booleans.

Synopsis

Type-level boolean values

class BoolI b => Bool b Source

Type-level Booleans

Instances

BoolI b => Bool b Source 

toBool :: BoolI b => b -> Bool Source

false :: False Source

False value-level reflecting function

true :: True Source

True value-level reflecting function

reifyBool :: Bool -> (forall b. Bool b => b -> r) -> r Source

Reification function. In CPS style (best possible solution)

Type-level boolean operations

class (BoolI b1, BoolI b2) => Not b1 b2 | b1 -> b2, b2 -> b1 Source

Boolean negation type-level relation. Not b1 b2 establishes that not b1 = b2

not :: Not b1 b2 => b1 -> b2 Source

value-level reflection function for the Not type-level relation

class (BoolI b1, BoolI b2, BoolI b3) => And b1 b2 b3 | b1 b2 -> b3 Source

And type-level relation. And b1 b2 b3 establishes that b1 && b2 = b3

(&&) :: And b1 b2 b3 => b1 -> b2 -> b3 infixr 3 Source

value-level reflection function for the And type-level relation

class (BoolI b1, BoolI b2, BoolI b3) => Or b1 b2 b3 | b1 b2 -> b3 Source

Or type-level relation. Or b1 b2 b3 establishes that b1 || b2 = b3

(||) :: Or b1 b2 b3 => b1 -> b2 -> b3 infixr 2 Source

value-level reflection function for the Or type-level relation

class (BoolI b1, BoolI b2, BoolI b3) => Xor b1 b2 b3 | b1 b2 -> b3 Source

Exclusive or type-level relation. Xor b1 b2 b3 establishes that xor b1 b2 = b3

xor :: Xor b1 b2 b3 => b1 -> b2 -> b3 infixl 6 Source

value-level reflection function for the Xor type-level relation

class (BoolI b1, BoolI b2, BoolI b3) => Imp b1 b2 b3 | b1 b2 -> b3 Source

Implication type-level relation. Imp b1 b2 b3 establishes that b1 =>b2 = b3

imp :: Imp b1 b2 b3 => b1 -> b2 -> b3 Source

value-level reflection function for the Imp type-level relation

class (BoolI b1, BoolI b2, BoolI b3) => Eq b1 b2 b3 | b1 b2 -> b3 Source

Boolean equality type-level relation

eq :: Eq b1 b2 b3 => b1 -> b2 -> b3 Source

value-level reflection function for the Eq type-level relation