HList-0.2.3: Heterogeneous lists

Data.HList.RecordP

Description

The HList library

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

Extensible records: labels are phantom, so at run-time, the record is just a heterogenous list of field values.

This sort of record is generalizable to tables (which are, at run-time, a list or a map containing the heterogenous lists of field values).

The are different models of labels that go with this module; see the files Label?.hs.

Documentation

newtype RecordP ls vs Source

Constructors

RecordP vs 

Instances

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 
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)) 
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 
(HEq l l' b, HasFieldP' b l (RecordP (HCons l' ls) vs) v) => HasField l (RecordP (HCons l' ls) vs) v 
(HMember l' ls b, H2ProjectByLabels' b ls (RecordP (HCons l' ls') vs') rin rout) => H2ProjectByLabels ls (RecordP (HCons l' ls') vs') rin rout 
(RecordR2P r ls vs, ShowComponents r, HRLabelSet r) => Show (RecordP ls vs) 
H2ProjectByLabels ls' (RecordP ls vs) (RecordP ls' vs') rout => SubType (RecordP ls vs) (RecordP ls' vs') 
(HLabelSet ls'', HAppend ls ls' ls'', HAppend vs vs' vs'', HSameLength ls'' vs'') => HAppend (RecordP ls vs) (RecordP ls' vs') (RecordP ls'' vs'') 
(HLabelSet (HCons l ls), HSameLength ls vs) => HExtend (LVPair l v) (RecordP ls vs) (RecordP (HCons l ls) (HCons v vs)) 
H2ProjectByLabels (HCons l ls) (RecordP HNil HNil) (RecordP HNil HNil) (RecordP HNil HNil) 

mkRecordP :: (HSameLength ls vs, HLabelSet ls) => ls -> vs -> RecordP ls vsSource

class HSameLength l1 l2 Source

Instances

HSameLength HNil HNil 
HSameLength l1 l2 => HSameLength (HCons e1 l1) (HCons e2 l2) 

class HRLabelSet r => RecordR2P r ls vs | r -> ls vs, ls vs -> r whereSource

Methods

record_r2p :: Record r -> RecordP ls vsSource

record_p2r :: RecordP ls vs -> Record rSource

Instances

RecordR2P HNil HNil HNil 
(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) 

class HasFieldP' b l r v | b l r -> v whereSource

Methods

hLookupByLabelP' :: b -> l -> r -> vSource

Instances

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 

hDeleteAtLabelP :: HProjectByLabelP l ls vs lso v vso => l -> RecordP ls vs -> RecordP lso vsoSource

hUpdateAtLabelP :: (HUpdateAtHNat n e1 t1 l', HFind e t n) => e -> e1 -> RecordP t t1 -> RecordP ls l'Source

class HProjectByLabelP l ls vs lso v vso | l ls vs -> lso v vso whereSource

Methods

h2ProjectByLabelP :: l -> RecordP ls vs -> (v, RecordP lso vso)Source

Instances

(HEq l l' b, HProjectByLabelP' b l (HCons l' ls) vs lso v vso) => HProjectByLabelP l (HCons l' ls) vs lso v vso 

class HProjectByLabelP' b l ls vs lso v vso | b l ls vs -> lso v vso whereSource

Methods

h2ProjectByLabelP' :: b -> l -> RecordP ls vs -> (v, RecordP lso vso)Source

Instances

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