HList-0.5.2.0: Heterogeneous lists
Safe HaskellNone
LanguageHaskell2010

Data.HList.TypeEqO

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

Instances details
TupleType () 'True Source # 
Instance details

Defined in Data.HList.TypeEqO

'False ~ b => TupleType x b Source # 
Instance details

Defined in Data.HList.TypeEqO

TupleType (x, y) 'True Source # 
Instance details

Defined in Data.HList.TypeEqO

TupleType (x, y, z) 'True Source # 
Instance details

Defined in Data.HList.TypeEqO

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

All our keywords must be registered

Instances

Instances details
'False ~ flag => IsKeyFN t flag Source #

overlapping/fallback case

Instance details

Defined in Data.HList.TypeEqO

IsKeyFN (Label s -> a -> b) 'True Source #

labels that impose no restriction on the type of the (single) argument which follows

>>> let testF (_ :: Label "a") (a :: Int) () = a+1
>>> kw (hBuild testF) (Label :: Label "a") 5 ()
6
Instance details

Defined in Data.HList.Keyword

r ~ (c -> b) => IsKeyFN (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.

Instance details

Defined in Data.HList.Keyword

Orphan instances

hZero ~ 'HZero => ArityFwd f hZero Source # 
Instance details

'False ~ b => HEq (x :: k) (y :: k) b Source # 
Instance details

HEq (x :: k) (x :: k) 'True Source # 
Instance details

Show (Proxy 'False) Source # 
Instance details

Show (Proxy 'True) Source # 
Instance details

HNat2Integral n => Show (Proxy n) Source # 
Instance details

Methods

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

show :: Proxy n -> String #

showList :: [Proxy n] -> ShowS #

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