type-int-0.5.0.1: Type Level 2s- and 16s- Complement Integers

Portabilitynon-portable (FD and MPTC, undecidable-instances)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Data.Type.Ord

Description

Simple equality and ordering for types. Extended to include common usage cases.

Instances should all really be decidable.

Documentation

class TBool b => TEq x y b | x y -> bSource

Instances

TEq F F T 
TEq F T F 
TEq T F F 
TEq T T T 
TEq Positive Positive T 
TEq Positive SignZero F 
TEq Positive Negative F 
TEq SignZero Positive F 
TEq SignZero SignZero T 
TEq SignZero Negative F 
TEq Negative Positive F 
TEq Negative SignZero F 
TEq Negative Negative T 
TEq TNothing TNothing T 
TEq TNothing (TJust a) F 
TEq (I m) F F 
TEq (I m) T F 
TEq (O m) T F 
TEq (O m) F F 
TEq (TJust a) TNothing F 
TEq m n b => TEq (I m) (I n) b 
TEq (I m) (O n) F

Equality comparison. Note this does not equate numbers that are non-normalized with their normalized kin.

TEq m n b => TEq (O m) (O n) b 
TEq (O m) (I n) F 
TEq a b r => TEq (TJust a) (TJust b) r 

tEq :: TEq x y b => x -> y -> bSource

class TBool b => TLt x y b | x y -> bSource

Instances

(TBool d, TNeg b b', TAdd' a b' c, TIsNegative c d) => TLt a b d

We have a total order.

TLt TNothing TNothing F 
TLt TNothing (TJust b) T 
TLt (TJust b) TNothing F 
TLt a b r => TLt (TJust a) (TJust b) r 

tLt :: TLt x y b => x -> y -> bSource

class TCGe Closure x y b => TGe x y b | x y -> bSource

Instances

(TBool b', TLt x y b, TNot b b') => TGe x y b' 

tGe :: TGe x y b => x -> y -> bSource

class TBool b => TLe x y b | x y -> bSource

Instances

(TBool b'', TEq x y b, TLt x y b', TOr b b' b'') => TLe x y b'' 

tLe :: TGt x y b => x -> y -> bSource

class TBool b => TGt x y b | x y -> bSource

Instances

(TBool b', TLe x y b, TNot b b') => TGt x y b' 

tGt :: TGt x y b => x -> y -> bSource