HList-0.2.3: Heterogeneous lists

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 Source

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 
HTMember e HNil HFalse 
HMemberM e HNil HNothing 
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 
HFoldr f v HNil v 
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) 
HList l => HEq HNil (HCons e l) HFalse 
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)

Shielding type-indexed operations The absence of signatures is deliberate! They all must be inferred.

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 
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 Source

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)) 
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 
(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) 
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') 
HList l => HEq HNil (HCons e l) HFalse 
(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 
(HEq e e' b, HMember e l b', HOr b b' b'') => HMember e (HCons e' l) b'' 
(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 
HProjectByHNats HNil (HCons e l) HNil 
HDeleteAtHNat HZero (HCons e l) l 
HLookupByHNat HZero (HCons e l) e 
(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')) 
(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) 
(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) 
(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) 
(HNat n, HNats ns) => HNats (HCons n ns) 
HList 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 
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) 
(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'' 
(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) 
(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) 
(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 Source

Instances

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

Public constructors

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

Basic list functions

class HHead l h | l -> h whereSource

Methods

hHead :: l -> hSource

Instances

HHead (HCons e l) e 

class HTail l l' | l -> l' whereSource

Methods

hTail :: l -> l'Source

Instances

HTail (HCons e l) l 

A class for extension

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

Methods

hExtend :: e -> l -> l'Source

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]Source

The normal append for comparison

class HAppend l l' l'' | l l' -> l'' whereSource

The class HAppend

Methods

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

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 whereSource

Methods

hReverse :: l1 -> l2Source

Instances

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

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

Methods

hReverse' :: l1 -> l2 -> l3Source

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' whereSource

Methods

naiveHReverse :: l -> l'Source

Instances

A nicer notation for lists

hEnd :: HCons t t1 -> HCons t t1Source

List termination

Note:

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

Building non-empty lists

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

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

Methods

hBuild' :: l -> a -> rSource

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 whereSource

Methods

apply :: f -> a -> rSource

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 Source

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 whereSource

Methods

hFoldr :: f -> v -> l -> rSource

Instances

HFoldr f v HNil v 
(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' whereSource

Methods

hMap :: f -> l -> l'Source

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 whereSource

Methods

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

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]Source

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

A reconstruction of append

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

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

Alternative implementation of hAppend. Demonstrates HFoldr

data ApplyHCons Source

Constructors

ApplyHCons 

Instances

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

A heterogeneous map for all types

data HMap' f Source

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 -> rSource

Same as hMap only a different implementation.

A function for showing

data HShow Source

Constructors

HShow 

Instances

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

data HSeq x Source

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' whereSource

Methods

hStagedEq' :: b -> e -> e' -> BoolSource

Instances

Ensure a list to contain HNats only

class HList l => HNats l Source

Instances

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

Static set property based on HEq

class HSet l Source

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 whereSource

Methods

hFind :: e -> l -> nSource

Instances

(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 whereSource

Methods

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

Instances

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

Membership test

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

Instances

HMember e HNil HFalse 
(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 -> bSource

Another type-level membership test

class HMemberM e l r | e l -> rSource

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 -> rSource

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 -> bSource

Instances

HTMember e HNil HFalse 
(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 -> bSource

Intersection based on HTMember

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

Methods

hTIntersect :: l1 -> l2 -> l3Source

Like Data.List.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 whereSource

Methods

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

Instances

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

Turn a heterogeneous list into a homogeneous one

class HList2List l e whereSource

Same as hMapOut Id

Methods

hList2List :: l -> [e]Source

Instances

With HMaybe

Turn list in a list of justs

class ToHJust l l' | l -> l' whereSource

Methods

toHJust :: l -> l'Source

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' whereSource

Methods

fromHJust :: l -> l'Source

Instances

Annotated lists

data HAddTag t Source

Constructors

HAddTag t 

Instances

Apply (HAddTag t) e (e, t) 

data HRmTag Source

Constructors

HRmTag 

Instances

Apply HRmTag (e, t) e 

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

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

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

Annotate list with a type-level Boolean

Splitting by HTrue and HFalse

class HSplit l l' l'' | l -> l' l'' whereSource

Analogus to Data.List.partition snd

Methods

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

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''