HList-0.3.4.1: Heterogeneous lists

Safe HaskellNone

Data.HList.HArray

Contents

Description

The HList library

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

Array-like access to HLists.

Synopsis

Lookup

class HLookupByHNat n l whereSource

Associated Types

type HLookupByHNatR n l :: *Source

Instances

HLookupByHNat HZero (: * e l) 
HLookupByHNat n l => HLookupByHNat (HSucc n) (: * e l) 

Delete

class HDeleteAtHNat n l whereSource

Associated Types

type HDeleteAtHNatR n l :: [*]Source

Instances

HDeleteAtHNat HZero (: * e l) 
HDeleteAtHNat n l => HDeleteAtHNat (HSucc n) (: * e l) 

Update

class HUpdateAtHNat n e l whereSource

Associated Types

type HUpdateAtHNatR n e l :: [*]Source

Methods

hUpdateAtHNat :: Proxy n -> e -> HList l -> HList (HUpdateAtHNatR n e l)Source

Instances

HUpdateAtHNat HZero e1 (: * e l) 
HUpdateAtHNat n e1 l => HUpdateAtHNat (HSucc n) e1 (: * e l) 

Projection

hProjectByHNats' :: (HMapAux (FHLookupByHNat l) as' bs', SameLength' * * as' bs', SameLength' * * bs' as') => HList as' -> HList l -> HList bs'Source

newtype FHLookupByHNat l Source

Constructors

FHLookupByHNat (HList l) 

Instances

data FHUProj sel ns Source

Constructors

FHUProj 

Instances

Apply (FHUProj sel ns) (HList l, Proxy HNat (HSucc n)) => Apply (Proxy Bool False, FHUProj sel ns) (HList (: * e l), Proxy HNat n) 
Apply (Proxy Bool True, FHUProj sel ns) (HList (: * e l), Proxy HNat n) 
(~ * ch (Proxy Bool (HBoolEQ sel (KMember n ns))), Apply (ch, FHUProj sel ns) (HList (: * e l), Proxy HNat n)) => Apply (FHUProj sel ns) (HList (: * e l), Proxy HNat n) 
Apply (FHUProj sel ns) (HList ([] *), n) 

type family KMember n ns :: BoolSource

Complement of Projection

Splitting

hSplitByHNats :: (Apply (FHUProj True ns) (t, Proxy HNat HZero), Apply (FHUProj False ns) (t, Proxy HNat HZero), HUnfold' (FHUProj True ns) (ApplyR (FHUProj True ns) (t, Proxy HNat HZero)), HUnfold' (FHUProj False ns) (ApplyR (FHUProj False ns) (t, Proxy HNat HZero))) => Proxy [HNat] ns -> t -> (HList (HUnfold (FHUProj True ns) (t, Proxy HNat HZero)), HList (HUnfold (FHUProj False ns) (t, Proxy HNat HZero)))Source

Splitting an array according to indices