HList-0.5.0.0: Heterogeneous lists

Safe HaskellNone
LanguageHaskell2010

Data.HList.TypeEqO

Contents

Description

The HList library

(C) 2004, Oleg Kiselyov, Ralf Laemmel, Keean Schupke

Generic type equality predicate: The implementation based on overlapping instances The only place where overlapping instances are really used besides Label5

Synopsis

Documentation

class TupleType (t :: *) (b :: Bool) | t -> b Source #

Instances

TupleType () True Source # 
(~) Bool False b => TupleType x b Source # 
TupleType (x, y) True Source # 
TupleType (x, y, z) True Source # 

class IsKeyFN (t :: *) (flag :: Bool) | t -> flag Source #

All our keywords must be registered

Instances

(~) Bool False flag => IsKeyFN t flag Source #

overlapping/fallback case

(~) * r (c -> b) => IsKeyFN (K k s c -> r) True Source #

The purpose of this instance is to be able to use the same Symbol (type-level string) at different types. If they are supposed to be the same, then use Label instead of K

>>> let kA = K :: forall t. K "a" t
>>> let testF (K :: K "a" Int) a1 (K :: K "a" Integer) a2 () = a1-fromIntegral a2

therefore the following options works:

>>> kw (hBuild testF) kA (5 :: Int) kA (3 :: Integer) ()
2
>>> kw (hBuild testF) (K :: K "a" Integer) 3 (K :: K "a" Int) 5 ()
2

But you cannot leave off all Int or Integer annotations.

Orphan instances

(~) HNat hZero HZero => ArityFwd f hZero Source # 
(~) Bool False b => HEq k x y b Source # 
HEq k x x True Source # 
Show (Proxy Bool False) Source # 
Show (Proxy Bool True) Source # 
HNat2Integral n => Show (Proxy HNat n) Source # 

Methods

showsPrec :: Int -> Proxy HNat n -> ShowS #

show :: Proxy HNat n -> String #

showList :: [Proxy HNat n] -> ShowS #

Arity f n => ArityFwd (x -> f) (HSucc n) Source #