HList-0.2.3: Heterogeneous lists

Data.HList.HArray

Contents

Description

The HList library

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

Array-like access to HLists.

Synopsis

Lookup

class HNat n => HLookupByHNat n l e | n l -> e whereSource

Methods

hLookupByHNat :: n -> l -> eSource

Instances

HLookupByHNat HZero (HCons e l) e 
(HLookupByHNat n l e', HNat n) => HLookupByHNat (HSucc n) (HCons e l) e' 

Delete

class HNat n => HDeleteAtHNat n l l' | n l -> l' whereSource

Methods

hDeleteAtHNat :: n -> l -> l'Source

Instances

HDeleteAtHNat HZero (HCons e l) l 
(HDeleteAtHNat n l l', HNat n) => HDeleteAtHNat (HSucc n) (HCons e l) (HCons e l') 

Update

class HNat n => HUpdateAtHNat n e l l' | n e l -> l', l' n -> e whereSource

Methods

hUpdateAtHNat :: n -> e -> l -> l'Source

Instances

HUpdateAtHNat HZero e' (HCons e l) (HCons e' l) 
(HUpdateAtHNat n e' l l', HNat n) => HUpdateAtHNat (HSucc n) e' (HCons e l) (HCons e l') 

Splitting

class HNats ns => HSplitByHNats' ns l l' l'' | ns l -> l' l'' whereSource

Splitting an array according to indices

Signature is inferred:

 hSplitByHNats :: (HSplitByHNats' ns l' l'1 l'', HMap (HAddTag HTrue) l l') =>
               ns -> l -> (l'1, l'')

Methods

hSplitByHNats' :: ns -> l -> (l', l'')Source

Instances

HSplit l l' l'' => HSplitByHNats' HNil l HNil l' 
(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'' 

Projection

class HNats ns => HProjectByHNats ns l l' | ns l -> l' whereSource

Methods

hProjectByHNats :: ns -> l -> l'Source

Instances

Complement of Projection

class HProjectAwayByHNats ns l l' | ns l -> l' whereSource

Methods

hProjectAwayByHNats :: ns -> l -> l'Source

Instances

(HLength l len, HBetween len nats, HDiff nats ns ns', HProjectByHNats ns' l l') => HProjectAwayByHNats ns l l' 

Enumerate naturals

class HBetween x y | x -> y whereSource

from 1 to x - 1

Methods

hBetween :: x -> ySource

Instances

Set-difference on naturals

class HDiff x y z | x y -> z whereSource

Methods

hDiff :: x -> y -> zSource

Instances

HDiff HNil x HNil 
(HOrdMember e y b, HDiff x y z, HCond b z (HCons e z) z') => HDiff (HCons e x) y z' 

Membership test for types with HOrd instances

class HOrdMember e l b | e l -> b whereSource

This special type equality/comparison is entirely pure!

Methods

hOrdMember :: e -> l -> bSource

Instances

HOrdMember e HNil HFalse 
(HEq e e' b1, HOrdMember e l b2, HOr b1 b2 b) => HOrdMember e (HCons e' l) b 

Length

class (HList l, HNat n) => HLength l n | l -> nSource

Instances

HLength HNil HZero 
(HLength l n, HNat n, HList l) => HLength (HCons a l) (HSucc n) 

hLength :: HLength l n => l -> nSource

Bounded lists

class HMaxLength l s Source

Instances

(HLength l s', HLt s' (HSucc s) HTrue) => HMaxLength l s 

class HMinLength l s Source

Instances

(HLength l s', HLt s (HSucc s') HTrue) => HMinLength l s 

class HSingleton l Source

Instances

hSingle :: (HSingleton l, HHead l e) => l -> eSource