HList-0.2.3: Heterogeneous lists

Safe HaskellNone

Data.HList.HListPrelude

Contents

Description

The HList library

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

Basic declarations for typeful heterogeneous lists.

Excuse the unstructured haddocks: while there are many declarations here some are alternative implementations should be grouped, and the definitions here are analgous to many list functions in the Prelude.

Synopsis

Heterogeneous type sequences

data HNil

Constructors

HNil 

Instances

Eq HNil 
Read HNil 
Show HNil 
Typeable HNil 
HSet HNil 
HNats HNil 
HList HNil 
HTypeIndexed HNil 
HTypeProxied HNil 
ShowComponents HNil 
HLabelSet HNil 
HRLabelSet HNil 
HasNoProxies HNil 
HStagedEq HNil HNil 
FromHJust HNil HNil 
ToHJust HNil HNil 
HList2List HNil e 
NaiveHReverse HNil HNil 
HLength HNil HZero 
HProject l HNil 
HOccursNot e HNil 
HOccursOpt e HNil 
Fail (TypeNotFound e) => HOccurs e HNil 
HOccursMany e HNil 
RecordValues HNil HNil 
RecordLabels HNil HNil 
HMaybied HNil HNil 
HSameLength HNil HNil 
Narrow a HNil 
HEq HNil HNil HTrue 
HSplit HNil HNil HNil 
HTIntersect HNil l HNil 
HBool HFalse => HTMember e HNil HFalse 
HMemberM e HNil HNothing 
HBool HFalse => HMember e HNil HFalse 
HMapOut f HNil e 
HMap f HNil HNil 
HReverse' l1 HNil l1 
HList l => HAppend HNil l l

The instance following the normal append

HZip HNil HNil HNil 
HOrdMember e HNil HFalse 
HDiff HNil x HNil 
HProjectByHNats HNil HNil HNil 
HTypes2HNats HNil l HNil 
HDeleteMany e HNil HNil 
HRearrange HNil HNil HNil 
RecordR2P HNil HNil HNil 
HDeleteMany e HNil HNil 
HList HNil => HFoldr f v HNil v 
(HNats HNil, HSplit l l' l'') => HSplitByHNats' HNil l HNil l' 
H2ProjectByLabels HNil r HNil r 
NarrowM' HNil rout b HNothing 
Fail (FieldNotFound l) => HRearrange' l ls HNil rout (FieldNotFound l)

For improved error messages

NarrowM a HNil (HJust (Record HNil)) 
HExtend e HNil (HCons e HNil) 
HRearrange ls rout r' => HRearrange' l ls (HCons (LVPair l v) HNil) rout (HCons (LVPair l v) r') 
TypeCast e' e => HOccurs e (TIP (HCons e' HNil)) 
UnionSymRec r1 (Record HNil) r1 
HLeftUnion r (Record HNil) r 
HStagedEq HNil (HCons e l) 
(HBool HFalse, HList l) => HEq HNil (HCons e l) HFalse 
HNats HNil => HProjectByHNats HNil (HCons e l) HNil 
Fail (ExtraField l) => HRearrange HNil (HCons (LVPair l v) a) (ExtraField l)

For improved error messages

SubType (TIP l) (TIP HNil) 
HBetween (HSucc HZero) (HCons HZero HNil) 
HRLabelSet (HCons x HNil) 
HStagedEq (HCons e l) HNil 
LubNarrow h h' e => HLub (HCons h (HCons h' HNil)) e 
(HBool HFalse, HList l) => HEq (HCons e l) HNil HFalse 
H2ProjectByLabels (HCons l ls) HNil HNil HNil 
(NarrowM rout b res', NarrowM'' f res' res) => NarrowM' (HCons f HNil) rout b res 
H2ProjectByLabels (HCons l ls) (RecordP HNil HNil) (RecordP HNil HNil) (RecordP HNil HNil) 

data HCons e l

Constructors

HCons e l 

Instances

(UnionSymRec r1 r2' (Record ru), HExtend f2 (Record ru) (Record (HCons f2 ru))) => UnionSymRec' HFalse r1 f2 r2' (Record (HCons f2 ru)) 
(HBool HTrue, HTIntersect t l1 l2) => HTIntersectBool HTrue h t l1 (HCons h l2) 
HDeleteMany e l l' => HDeleteManyCase HFalse e e' l (HCons e' l') 
HLeftUnionBool HFalse r f (HCons f r) 
HReverse (HCons a l) (HCons a' l') => HBuild' l a (HCons a' l') 
HExtend e HNil (HCons e HNil) 
(HOccurs' e l, HList l) => HOccursBool HFalse e (HCons e' l) 
(HList l, HOccursNot e l) => HOccursBool HTrue e (HCons e l) 
(HMemberM e l r, HMemberM' r e (HCons e' l) res) => HMemberM' HFalse e (HCons e' l) res 
(HList (HCons e l), HFoldr f v l r, Apply f (e, r) r') => HFoldr f v (HCons e l) r' 
HasField l r v => HasField' HFalse l (HCons fld r) v 
HasField' HTrue l (HCons (LVPair l v) r) v 
HasField l (RecordP ls vs) v => HasFieldP' HFalse l (RecordP (HCons l' ls) (HCons v' vs)) v 
HasFieldP' HTrue l (RecordP (HCons l ls) (HCons v vs)) v 
HRearrange ls rout r' => HRearrange' l ls (HCons (LVPair l v) HNil) rout (HCons (LVPair l v) r') 
H2ProjectByLabels ls r' rin rout => H2ProjectByLabels' HNothing ls (HCons f' r') rin (HCons f' rout) 
H2ProjectByLabels ls (RecordP ls' vs') rin (RecordP lo vo) => H2ProjectByLabels' HFalse ls (RecordP (HCons l' ls') (HCons v' vs')) rin (RecordP (HCons l' lo) (HCons v' vo)) 
HMemberM' HTrue e (HCons e l) (HJust l) 
HNat HZero => HUpdateAtHNat HZero e' (HCons e l) (HCons e' l) 
H2ProjectByLabels ls (RecordP ls' vs') (RecordP lin vin) rout => H2ProjectByLabels' HTrue ls (RecordP (HCons l' ls') (HCons v' vs')) (RecordP (HCons l' lin) (HCons v' vin)) rout 
HProjectByLabelP' HTrue l (HCons l ls) (HCons v vs) ls v vs 
HProjectByLabelP l ls vs lso' v vso' => HProjectByLabelP' HFalse l (HCons l' ls) (HCons v' vs) (HCons l' lso') v (HCons v' vso') 
HOccurs e (HCons x (HCons y l)) => HOccurs e (TIP (HCons x (HCons y l))) 
TypeCast e' e => HOccurs e (TIP (HCons e' HNil)) 
(HOccursNot e l, HTypeIndexed l) => HExtend e (TIP l) (TIP (HCons e l)) 
NarrowM'' f (HJust (Record r)) (HJust (Record (HCons f r))) 
HStagedEq HNil (HCons e l) 
(HList l', HOccurs e l, HProject l l') => HProject l (HCons e l') 
HOccursNot e l => HOccursNot e (HCons e' l) 
Fail (TypeFound e) => HOccursNot e (HCons e l) 
HOccursOpt e l => HOccursOpt e (HCons e' l) 
HOccursOpt e (HCons e l) 
(TypeEq e e' b, HOccursBool b e (HCons e' l)) => HOccurs' e (HCons e' l) 
(HOccurs e l, HList l) => HOccurs e (HCons e' l) 
(HList l, HOccursNot e l) => HOccurs e (HCons e l) 
(HOccursFst e l, HList l) => HOccursFst e (HCons e' l) 
HList l => HOccursFst e (HCons e l) 
(HOccursMany1 e l, HList l) => HOccursMany1 e (HCons e' l) 
(HOccursMany e l, HList l) => HOccursMany1 e (HCons e l) 
(HOccursMany e l, HList l) => HOccursMany e (HCons e' l) 
(HOccursMany e l, HList l) => HOccursMany e (HCons e l) 
(Narrow rout r', H2ProjectByLabels (HCons l HNil) r (HCons (LVPair l v) HNil) rout) => Narrow r (HCons (LVPair l v) r') 
(HBool HFalse, HList l) => HEq HNil (HCons e l) HFalse 
(HBool b'', TypeEq e e' b, HTMember e l b', HOr b b' b'') => HTMember e (HCons e' l) b'' 
(HEq e e' b, HMemberM' b e (HCons e' l) res) => HMemberM e (HCons e' l) res 
(HBool b'', HEq e e' b, HMember e l b', HOr b b' b'') => HMember e (HCons e' l) b'' 
(HNat n, HEq e e' b, HFind' b e l n) => HFind e (HCons e' l) n 
(HMapOut f l e', Apply f e e') => HMapOut f (HCons e l) e' 
HReverse' (HCons a l1) l2' l3 => HReverse' l1 (HCons a l2') l3 
(HEq e e' b1, HOrdMember e l b2, HOr b1 b2 b) => HOrdMember e (HCons e' l) b 
HNats HNil => HProjectByHNats HNil (HCons e l) HNil 
HNat HZero => HDeleteAtHNat HZero (HCons e l) l 
HNat HZero => HLookupByHNat HZero (HCons e l) e 
(HNat n, TypeEq e' e b, HType2HNatCase b e l n) => HType2HNat e (HCons e' l) n 
(HList l, TypeEq e e' b, HDeleteManyCase b e e' l l') => HDeleteMany e (HCons e' l) l' 
(HEq l l' b, HasField' b l (HCons (LVPair l' v') r) v) => HasField l (HCons (LVPair l' v') r) v 
(HEq l l' b, HasFieldP' b l (RecordP (HCons l' ls) vs) v) => HasField l (RecordP (HCons l' ls) vs) v 
(HList l, HDeleteMany e l l', TypeCast (HCons e' l') l'') => HDeleteMany e (HCons e' l) l'' 
(HList l, HDeleteMany e l l') => HDeleteMany e (HCons e l) l' 
(H2ProjectByLabels (HCons l HNil) a rin rout, NarrowM' rin rout b res) => NarrowM a (HCons (LVPair l v) b) res 
(HMember l' ls b, H2ProjectByLabels' b ls (RecordP (HCons l' ls') vs') rin rout) => H2ProjectByLabels ls (RecordP (HCons l' ls') vs') rin rout 
(HEq l l' b, HProjectByLabelP' b l (HCons l' ls) vs lso v vso) => HProjectByLabelP l (HCons l' ls) vs lso v vso 
Fail (ExtraField l) => HRearrange HNil (HCons (LVPair l v) a) (ExtraField l)

For improved error messages

(Apply f x y, HMap f xs ys) => HMap f (HCons x xs) (HCons y ys) 
HList l => Apply ApplyHCons (e, l) (HCons e l) 
HList l => HExtend e (HCons e' l) (HCons e (HCons e' l)) 
HMemberM' (HJust l') e (HCons e' l) (HJust (HCons e' l')) 
(HNat (HSucc n), HUpdateAtHNat n e' l l', HNat n) => HUpdateAtHNat (HSucc n) e' (HCons e l) (HCons e l') 
H2ProjectByLabels ls' r' rin rout => H2ProjectByLabels' (HJust ls') ls (HCons f' r') (HCons f' rin) rout 
(HOccurs e l, SubType (TIP l) (TIP l')) => SubType (TIP l) (TIP (HCons e l')) 
(RecordLabels r1 ls, HMember l ls b, UnionSymRec' b (Record r1) (LVPair l v) (Record r2') ru) => UnionSymRec (Record r1) (Record (HCons (LVPair l v) r2')) ru 
(RecordLabels r ls, HMember l ls b, HLeftUnionBool b r (LVPair l v) r''', HLeftUnion (Record r''') (Record r') r'') => HLeftUnion (Record r) (Record (HCons (LVPair l v) r')) r'' 
HBetween (HSucc HZero) (HCons HZero HNil) 
(HNat (HSucc n), HLookupByHNat n l e', HNat n) => HLookupByHNat (HSucc n) (HCons e l) e' 
Apply f e e' => Apply (HMap' f) (e, l) (HCons e' l) 
(HNat (HSucc n), HDeleteAtHNat n l l', HNat n) => HDeleteAtHNat (HSucc n) (HCons e l) (HCons e l') 
(Eq e, Eq l) => Eq (HCons e l) 
(Read e, Read l) => Read (HCons e l) 
(Show e, Show l) => Show (HCons e l) 
(Typeable x, Typeable y) => Typeable (HCons x y) 
(HMember e l HFalse, HSet l) => HSet (HCons e l) 
(HList (HCons n ns), HNat n, HNats ns) => HNats (HCons n ns) 
HList l => HList (HCons e l) 
(HList (HCons e l), HOccursNot e l, HTypeIndexed l) => HTypeIndexed (HCons e l) 
HTypeProxied l => HTypeProxied (HCons (Proxy e) l) 
(ShowLabel l, Show v, ShowComponents r) => ShowComponents (HCons (LVPair l v) r) 
(HMember x ls xmem, HLabelSet' x ls xmem) => HLabelSet (HCons x ls) 
HRLabelSet (HCons x HNil) 
(HEq l1 l2 leq, HRLabelSet' l1 v1 l2 v2 leq r) => HRLabelSet (HCons (LVPair l1 v1) (HCons (LVPair l2 v2) r)) 
HasNoProxies l => HasNoProxies (HCons e l) 
Fail (ProxyFound x) => HasNoProxies (HCons (Proxy x) l) 
Fail (ProxyFound x) => HasNoProxies (HCons (LVPair lab (Proxy x)) l) 
HStagedEq (HCons e l) HNil 
FromHJust l l' => FromHJust (HCons HNothing l) l' 
HList2List l e => HList2List (HCons e l) e 
(NaiveHReverse l l', HAppend l' (HCons e HNil) l'') => NaiveHReverse (HCons e l) l'' 
HTail (HCons e l) l 
HHead (HCons e l) e 
(HLub (HCons h (HCons h'' t)) e', HLub (HCons h' (HCons h'' t)) e'', LubNarrow e' e'' e, HLub (HCons e (HCons h'' t)) e) => HLub (HCons h (HCons h' (HCons h'' t))) e 
LubNarrow h h' e => HLub (HCons h (HCons h' HNil)) e 
(HBool HFalse, HList l) => HEq (HCons e l) HNil HFalse 
(HTMember h l1 b, HTIntersectBool b h t l1 l2) => HTIntersect (HCons h t) l1 l2 
(HOrdMember e y b, HDiff x y z, HCond b z (HCons e z) z') => HDiff (HCons e x) y z' 
(H2ProjectByLabels (HCons l HNil) r rin rout, HRearrange' l ls rin rout r') => HRearrange (HCons l ls) r r' 
H2ProjectByLabels (HCons l ls) HNil HNil HNil 
(NarrowM rout b res', NarrowM'' f res' res) => NarrowM' (HCons f HNil) rout b res 
HSplit l l' l'' => HSplit (HCons (e, HFalse) l) l' (HCons e l'') 
(HList l, HAppend l l' l'') => HAppend (HCons x l) l' (HCons x l'') 
(HType2HNat e l n, HTypes2HNats ps l ns) => HTypes2HNats (HCons (Proxy e) ps) l (HCons n ns) 
(HNats (HCons n ns), HLookupByHNat n l (e, b), HUpdateAtHNat n (e, HFalse) l l''', HSplitByHNats' ns l''' l' l'') => HSplitByHNats' (HCons n ns) l (HCons e l') l'' 
(HList (HCons a l), HNat (HSucc n), HLength l n, HNat n, HList l) => HLength (HCons a l) (HSucc n) 
HRLabelSet (HCons (LVPair l v) r) => HExtend (LVPair l v) (Record r) (Record (HCons (LVPair l v) r)) 
(TypeEq e e' b, HStagedEq l l', HStagedEq' b e e') => HStagedEq (HCons e l) (HCons e' l') 
FromHJust l l' => FromHJust (HCons (HJust e) l) (HCons e l') 
ToHJust l l' => ToHJust (HCons e l) (HCons (HJust e) l') 
RecordValues r' vs => RecordValues (HCons (LVPair l v) r') (HCons v vs) 
RecordLabels r' ls => RecordLabels (HCons (LVPair l v) r') (HCons l ls) 
HMaybied r r' => HMaybied (HCons (LVPair l (Proxy v)) r) (HCons (LVPair l (Maybe v)) r') 
HSameLength l1 l2 => HSameLength (HCons e1 l1) (HCons e2 l2) 
(HBool b'', HList l, HList l', HEq e e' b, HEq l l' b', HAnd b b' b'') => HEq (HCons e l) (HCons e' l') b'' 
HSplit l l' l'' => HSplit (HCons (e, HTrue) l) (HCons e l') l'' 
(HMemberM l' (HCons l ls) b, H2ProjectByLabels' b (HCons l ls) (HCons (LVPair l' v') r') rin rout) => H2ProjectByLabels (HCons l ls) (HCons (LVPair l' v') r') rin rout 
(HLabelSet (HCons l ls), HSameLength ls vs) => HExtend (LVPair l v) (RecordP ls vs) (RecordP (HCons l ls) (HCons v vs)) 
HZip tx ty l => HZip (HCons hx tx) (HCons hy ty) (HCons (hx, hy) l) 
(HNats (HCons n ns), HLookupByHNat n (HCons e l) e', HProjectByHNats ns (HCons e l) l') => HProjectByHNats (HCons n ns) (HCons e l) (HCons e' l') 
(RecordR2P r ls vs, HRLabelSet (HCons (LVPair l v) r), HLabelSet (HCons l ls), HSameLength ls vs) => RecordR2P (HCons (LVPair l v) r) (HCons l ls) (HCons v vs) 
H2ProjectByLabels (HCons l ls) (RecordP HNil HNil) (RecordP HNil HNil) (RecordP HNil HNil) 

The set of all types of heterogeneous lists

class HList l

Instances

HList HNil 
HList l => HList (HCons e l) 

Public constructors

hCons :: HList l => e -> l -> HCons e l

Basic list functions

class HHead l h | l -> h where

Methods

hHead :: l -> h

Instances

HHead (HCons e l) e 

class HTail l l' | l -> l' where

Methods

hTail :: l -> l'

Instances

HTail (HCons e l) l 

A class for extension

class HExtend e l l' | e l -> l', l' -> e l where

Methods

hExtend :: e -> l -> l'

Instances

HExtend e HNil (HCons e HNil) 
(HOccursNot e l, HTypeIndexed l) => HExtend e (TIP l) (TIP (HCons e l)) 
HList l => HExtend e (HCons e' l) (HCons e (HCons e' l)) 
HRLabelSet (HCons (LVPair l v) r) => HExtend (LVPair l v) (Record r) (Record (HCons (LVPair l v) r)) 
(HLabelSet (HCons l ls), HSameLength ls vs) => HExtend (LVPair l v) (RecordP ls vs) (RecordP (HCons l ls) (HCons v vs)) 

Appending HLists

append :: [a] -> [a] -> [a]

The normal append for comparison

class HAppend l l' l'' | l l' -> l'' where

The class HAppend

Methods

hAppend :: l -> l' -> l''

Instances

HList l => HAppend HNil l l

The instance following the normal append

(HAppend l l' l'', HTypeIndexed l'') => HAppend (TIP l) (TIP l') (TIP l'') 
(HRLabelSet r'', HAppend r r' r'') => HAppend (Record r) (Record r') (Record r'') 
(HList l, HAppend l l' l'') => HAppend (HCons x l) l' (HCons x l'') 
(HLabelSet ls'', HAppend ls ls' ls'', HAppend vs vs' vs'', HSameLength ls'' vs'') => HAppend (RecordP ls vs) (RecordP ls' vs') (RecordP ls'' vs'') 

Reversing HLists

class HReverse l1 l2 | l1 -> l2, l2 -> l1 where

Methods

hReverse :: l1 -> l2

Instances

(HReverse' HNil l2 l3, HReverse' HNil l3 l2) => HReverse l2 l3 

class HReverse' l1 l2 l3 | l1 l2 -> l3 where

Methods

hReverse' :: l1 -> l2 -> l3

Instances

HReverse' l1 HNil l1 
HReverse' (HCons a l1) l2' l3 => HReverse' l1 (HCons a l2') l3 

Naive HReverse

class NaiveHReverse l l' | l -> l' where

Methods

naiveHReverse :: l -> l'

Instances

A nicer notation for lists

hEnd :: HCons t t1 -> HCons t t1

Note:

x :: HCons a b
means: forall a b. x :: HCons a b
hEnd x
means: exists a b. x :: HCons a b

List termination

Building non-empty lists

hBuild :: HBuild' HNil a r => a -> r

class HBuild' l a r | r -> a l where

Methods

hBuild' :: l -> a -> r

Instances

HBuild' (HCons a l) b r => HBuild' l a (b -> r) 
HReverse (HCons a l) (HCons a' l') => HBuild' l a (HCons a' l') 
 HList> let x = hBuild True in hEnd x
 HCons True HNil
 HList> let x = hBuild True 'a' in hEnd x
 HCons True (HCons 'a' HNil)
 HList> let x = hBuild True 'a' "ok" in hEnd x
 HCons True (HCons 'a' (HCons "ok" HNil))
 HList> hEnd (hBuild (Key 42) (Name "Angus") Cow (Price 75.5))
 HCons (Key 42) (HCons (Name "Angus") (HCons Cow (HCons (Price 75.5) HNil)))
 HList> hEnd (hBuild (Key 42) (Name "Angus") Cow (Price 75.5)) == angus
 True

A heterogeneous apply operator

class Apply f a r | f a -> r where

Methods

apply :: f -> a -> r

Instances

Apply Id x x 
Show x => Apply HShow x (IO ()) 
Apply HRmTag (e, t) e 
HList l => Apply ApplyHCons (e, l) (HCons e l) 
Apply (HAddTag t) e (e, t) 
(Monad m, Apply f x (m ())) => Apply (HSeq f) (x, m ()) (m ()) 
Apply f e e' => Apply (HMap' f) (e, l) (HCons e' l) 
Apply (x -> y) x y

Normal function application

data Id

Identity

Constructors

Id 

Instances

Apply Id x x 

A heterogeneous fold for all types

class HList l => HFoldr f v l r | f v l -> r where

Methods

hFoldr :: f -> v -> l -> r

Instances

HList HNil => HFoldr f v HNil v 
(HList (HCons e l), HFoldr f v l r, Apply f (e, r) r') => HFoldr f v (HCons e l) r' 

Map

class HMap f l l' | f l -> l' where

Methods

hMap :: f -> l -> l'

Instances

HMap f HNil HNil 
(Apply f x y, HMap f xs ys) => HMap f (HCons x xs) (HCons y ys) 

Map a heterogeneous list to a homogeneous one

class HMapOut f r e where

Methods

hMapOut :: f -> r -> [e]

Instances

HMapOut f HNil e 
(HMapOut f l e', Apply f e e') => HMapOut f (HCons e l) e' 

A heterogenous version of mapM.

hMapM :: (Monad m, HMapOut f l (m e)) => f -> l -> [m e]

hMapM_ :: (Monad m, HMapOut f l (m ())) => f -> l -> m ()

A reconstruction of append

append' :: [a] -> [a] -> [a]

hAppend' :: HFoldr ApplyHCons v l r => l -> v -> r

Alternative implementation of hAppend. Demonstrates HFoldr

data ApplyHCons

Constructors

ApplyHCons 

Instances

HList l => Apply ApplyHCons (e, l) (HCons e l) 

A heterogeneous map for all types

data HMap' f

Constructors

HMap' f 

Instances

Apply f e e' => Apply (HMap' f) (e, l) (HCons e' l) 

hMap' :: HFoldr (HMap' f) HNil l r => f -> l -> r

Same as hMap only a different implementation.

A function for showing

data HShow

Constructors

HShow 

Instances

Show x => Apply HShow x (IO ()) 

data HSeq x

Constructors

HSeq x 

Instances

(Monad m, Apply f x (m ())) => Apply (HSeq f) (x, m ()) (m ()) 

Type-level equality for lists

Staged equality for lists

class HStagedEq' b e e' where

Methods

hStagedEq' :: b -> e -> e' -> Bool

Instances

Ensure a list to contain HNats only

class HList l => HNats l

Instances

HNats HNil 
(HList (HCons n ns), HNat n, HNats ns) => HNats (HCons n ns) 

Static set property based on HEq

class HSet l

Instances

HSet HNil 
(HMember e l HFalse, HSet l) => HSet (HCons e l) 

Find an element in a set based on HEq

class HNat n => HFind e l n | e l -> n where

Methods

hFind :: e -> l -> n

Instances

(HNat n, HEq e e' b, HFind' b e l n) => HFind e (HCons e' l) n 

class HNat n => HFind' b e l n | b e l -> n where

Methods

hFind' :: b -> e -> l -> n

Instances

HNat HZero => HFind' HTrue e l HZero 
(HNat (HSucc n), HFind e l n) => HFind' HFalse e l (HSucc n) 

Membership test

class HBool b => HMember e l b | e l -> b

Instances

HBool HFalse => HMember e HNil HFalse 
(HBool b'', HEq e e' b, HMember e l b', HOr b b' b'') => HMember e (HCons e' l) b'' 

hMember :: HMember e l b => e -> l -> b

Another type-level membership test

class HMemberM e l r | e l -> r

Instances

HMemberM e HNil HNothing 
(HEq e e' b, HMemberM' b e (HCons e' l) res) => HMemberM e (HCons e' l) res 

class HMemberM' b e l r | b e l -> r

Instances

HMemberM' HNothing e l HNothing 
(HMemberM e l r, HMemberM' r e (HCons e' l) res) => HMemberM' HFalse e (HCons e' l) res 
HMemberM' HTrue e (HCons e l) (HJust l) 
HMemberM' (HJust l') e (HCons e' l) (HJust (HCons e' l')) 

Membership test based on type equality

class HBool b => HTMember e l b | e l -> b

Instances

HBool HFalse => HTMember e HNil HFalse 
(HBool b'', TypeEq e e' b, HTMember e l b', HOr b b' b'') => HTMember e (HCons e' l) b'' 

hTMember :: HTMember e l b => e -> l -> b

Intersection based on HTMember

class HTIntersect l1 l2 l3 | l1 l2 -> l3 where

Methods

hTIntersect :: l1 -> l2 -> l3

Like intersect

Instances

HTIntersect HNil l HNil 
(HTMember h l1 b, HTIntersectBool b h t l1 l2) => HTIntersect (HCons h t) l1 l2 

class HBool b => HTIntersectBool b h t l1 l2 | b h t l1 -> l2 where

Methods

hTIntersectBool :: b -> h -> t -> l1 -> l2

Instances

(HBool HFalse, HTIntersect t l1 l2) => HTIntersectBool HFalse h t l1 l2 
(HBool HTrue, HTIntersect t l1 l2) => HTIntersectBool HTrue h t l1 (HCons h l2) 

Turn a heterogeneous list into a homogeneous one

class HList2List l e where

Same as hMapOut Id

Methods

hList2List :: l -> [e]

Instances

With HMaybe

Turn list in a list of justs

class ToHJust l l' | l -> l' where

Methods

toHJust :: l -> l'

Instances

ToHJust HNil HNil 
ToHJust l l' => ToHJust (HCons e l) (HCons (HJust e) l') 

Extract justs from list of maybes

class FromHJust l l' | l -> l' where

Methods

fromHJust :: l -> l'

Instances

Annotated lists

data HAddTag t

Constructors

HAddTag t 

Instances

Apply (HAddTag t) e (e, t) 

data HRmTag

Constructors

HRmTag 

Instances

Apply HRmTag (e, t) e 

hAddTag :: HMap (HAddTag t) l l' => t -> l -> l'

hRmTag :: HMap HRmTag l l' => l -> l'

hFlag :: HMap (HAddTag HTrue) l l' => l -> l'

Annotate list with a type-level Boolean

Splitting by HTrue and HFalse

class HSplit l l' l'' | l -> l' l'' where

Analogus to Data.List.partition snd

Methods

hSplit :: l -> (l', l'')

Instances

HSplit HNil HNil HNil 
HSplit l l' l'' => HSplit (HCons (e, HFalse) l) l' (HCons e l'') 
HSplit l l' l'' => HSplit (HCons (e, HTrue) l) (HCons e l') l''