HList-0.5.0.0: Heterogeneous lists

Safe HaskellNone
LanguageHaskell2010

Data.HList.HTypeIndexed

Contents

Description

The HList library

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

Type-indexed operations on typeful heterogeneous lists.

Synopsis

Documentation

class HType2HNatCase (b :: Bool) (e :: *) (l :: [*]) (n :: HNat) | b e l -> n Source #

Helper class

hType2HNat :: HType2HNat e l n => proxy1 e -> proxy l -> Proxy n Source #

hTypes2HNats :: HTypes2HNats es l ns => Proxy (es :: [*]) -> hlist l -> Proxy (ns :: [HNat]) Source #

class HDeleteManyCase (b :: Bool) e1 e l l1 | b e1 e l -> l1 where Source #

Minimal complete definition

hDeleteManyCase

Methods

hDeleteManyCase :: Proxy b -> Proxy e1 -> e -> HList l -> HList l1 Source #

Instances

HDeleteMany k e1 (HList l) (HList l1) => HDeleteManyCase k False e1 e l ((:) * e l1) Source # 

Methods

hDeleteManyCase :: Proxy Bool e1 -> Proxy False e -> l -> HList ((* ': e) l1) -> HList l1 Source #

HDeleteMany * e (HList l) (HList l1) => HDeleteManyCase * True e e l l1 Source # 

Methods

hDeleteManyCase :: Proxy Bool e -> Proxy True e -> l -> HList l1 -> HList l1 Source #

hDeleteAt :: (HType2HNat * e l n, HDeleteAtHNat n l) => proxy1 e -> HList l -> HList (HDeleteAtHNatR n l) Source #

hUpdateAt :: (HType2HNat * e l n, HUpdateAtHNat' n e l l) => e -> HList l -> HList (HUpdateAtHNatR n e l) Source #

hProjectBy :: (HTypes2HNats [*] k es l ns, Apply (FHUProj True ns) (hlist l, Proxy HNat HZero), HUnfoldFD (FHUProj True ns) (ApplyR (FHUProj True ns) (hlist l, Proxy HNat HZero)) z) => Proxy [*] es -> hlist l -> HList z Source #

hSplitBy :: (HTypes2HNats [*] k es l ns, HUnfoldFD (FHUProj True ns) (ApplyR (FHUProj True ns) (hlist l, Proxy HNat HZero)) z1, HUnfoldFD (FHUProj False ns) (ApplyR (FHUProj False ns) (hlist l, Proxy HNat HZero)) z2, Apply (FHUProj True ns) (hlist l, Proxy HNat HZero), Apply (FHUProj False ns) (hlist l, Proxy HNat HZero)) => Proxy [*] es -> hlist l -> (HList z1, HList z2) Source #

Orphan instances

(HDeleteAtHNat n l, HType2HNat * e l n, (~) [*] l' (HDeleteAtHNatR n l)) => HDeleteAtLabel * HList e l l' Source #

should this instead delete the first element of that type?

Methods

hDeleteAtLabel :: Label HList l -> e l' -> e v' Source #

HDeleteMany k e (HList ([] *)) (HList ([] *)) Source # 

Methods

hDeleteMany :: Proxy e (HList [*]) -> HList [*] -> l' Source #

(HEq * e1 e b, HType2HNatCase b e1 l n) => HType2HNat * e1 ((:) * e l) n Source #

Map a type to a natural (index within the collection) This is a purely type-level computation

(HEq * e1 e b, HDeleteManyCase * b e1 e l l1) => HDeleteMany * e1 (HList ((:) * e l)) (HList l1) Source # 

Methods

hDeleteMany :: Proxy e1 (HList ((* ': e) l)) -> HList l1 -> l' Source #

HTypes2HNats [*] [*] ([] *) l ([] HNat) Source #

And lift to the list of types

(HType2HNat * e l n, HTypes2HNats [*] [*] es l ns) => HTypes2HNats [*] [*] ((:) * e es) l ((:) HNat n ns) Source #