Safe Haskell | None |
---|---|
Language | Haskell2010 |
The HList library
(C) 2004, Oleg Kiselyov, Ralf Laemmel, Keean Schupke
Array-like access to HLists.
- class HLookupByHNat n l where
- type HLookupByHNatR n l :: *
- hLookupByHNat :: Proxy n -> HList l -> HLookupByHNatR n l
- class HDeleteAtHNat n l where
- type HDeleteAtHNatR n l :: [*]
- hDeleteAtHNat :: Proxy n -> HList l -> HList (HDeleteAtHNatR n l)
- class HUpdateAtHNat n e l where
- type HUpdateAtHNatR n e l :: [*]
- hUpdateAtHNat :: Proxy n -> e -> HList l -> HList (HUpdateAtHNatR n e l)
- hProjectByHNats' :: (HMapAux r (FHLookupByHNat l) a b, SameLength' * * b a, SameLength' * * a b) => r a -> HList l -> r b
- newtype FHLookupByHNat l = FHLookupByHNat (HList l)
- hProjectByHNats :: (HUnfoldFD (FHUProj True ns) (ApplyR (FHUProj True ns) (t, Proxy HNat HZero)) z, Apply (FHUProj True ns) (t, Proxy HNat HZero)) => Proxy [HNat] ns -> t -> HList z
- data FHUProj sel ns = FHUProj
- type family KMember n ns :: Bool
- type HProjectByHNatsR ns l = HUnfold (FHUProj True ns) (HList l, Proxy HZero)
- type HProjectByHNatsCtx ns l = (Apply (FHUProj True ns) (HList l, Proxy HZero), HUnfold' (FHUProj True ns) (HList l, Proxy HZero))
- hProjectAwayByHNats :: (HUnfoldFD (FHUProj False ns) (ApplyR (FHUProj False ns) (t, Proxy HNat HZero)) z, Apply (FHUProj False ns) (t, Proxy HNat HZero)) => Proxy [HNat] ns -> t -> HList z
- type HProjectAwayByHNatsR ns l = HUnfold (FHUProj False ns) (HList l, Proxy HZero)
- type HProjectAwayByHNatsCtx ns l = (Apply (FHUProj False ns) (HList l, Proxy HZero), HUnfold' (FHUProj False ns) (HList l, Proxy HZero))
- hSplitByHNats :: (HUnfoldFD (FHUProj True ns) (ApplyR (FHUProj True ns) (t, Proxy HNat HZero)) z, HUnfoldFD (FHUProj False ns) (ApplyR (FHUProj False ns) (t, Proxy HNat HZero)) z1, Apply (FHUProj True ns) (t, Proxy HNat HZero), Apply (FHUProj False ns) (t, Proxy HNat HZero)) => Proxy [HNat] ns -> t -> (HList z, HList z1)
Lookup
class HLookupByHNat n l where Source
type HLookupByHNatR n l :: * Source
hLookupByHNat :: Proxy n -> HList l -> HLookupByHNatR n l Source
HLookupByHNat HZero ((:) * e l) | |
HLookupByHNat n l => HLookupByHNat (HSucc n) ((:) * e l) |
Delete
class HDeleteAtHNat n l where Source
type HDeleteAtHNatR n l :: [*] Source
hDeleteAtHNat :: Proxy n -> HList l -> HList (HDeleteAtHNatR n l) Source
HDeleteAtHNat HZero ((:) * e l) | |
HDeleteAtHNat n l => HDeleteAtHNat (HSucc n) ((:) * e l) |
Update
class HUpdateAtHNat n e l where Source
type HUpdateAtHNatR n e l :: [*] Source
hUpdateAtHNat :: Proxy n -> e -> HList l -> HList (HUpdateAtHNatR n e l) Source
Fail * (FieldNotFound * (Proxy HNat n, e1)) => HUpdateAtHNat n e1 ([] *) | |
HUpdateAtHNat HZero e1 ((:) * e l) | |
HUpdateAtHNat n e1 l => HUpdateAtHNat (HSucc n) e1 ((:) * e l) |
Projection
hProjectByHNats' :: (HMapAux r (FHLookupByHNat l) a b, SameLength' * * b a, SameLength' * * a b) => r a -> HList l -> r b Source
newtype FHLookupByHNat l Source
FHLookupByHNat (HList l) |
HLookupByHNat n l => Apply (FHLookupByHNat l) (Proxy HNat n) | |
type ApplyR (FHLookupByHNat l) (Proxy HNat n) = HLookupByHNatR n l |
hProjectByHNats :: (HUnfoldFD (FHUProj True ns) (ApplyR (FHUProj True ns) (t, Proxy HNat HZero)) z, Apply (FHUProj True ns) (t, Proxy HNat HZero)) => Proxy [HNat] ns -> t -> HList z Source
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 ApplyR (Proxy Bool False, FHUProj sel ns) (HList ((:) * e l), Proxy HNat n) = ApplyR (FHUProj sel ns) (HList l, Proxy HNat (HSucc n)) | |
type ApplyR (Proxy Bool True, FHUProj sel ns) (HList ((:) * e l), Proxy HNat n) = HJust (e, (HList l, Proxy HNat (HSucc n))) | |
type ApplyR (FHUProj sel ns) (HList ((:) * e l), Proxy HNat n) = ApplyR (Proxy Bool (HBoolEQ sel (KMember n ns)), FHUProj sel ns) (HList ((:) * e l), Proxy HNat n) | |
type ApplyR (FHUProj sel ns) (HList ([] *), n) = HNothing |
type HProjectByHNatsCtx ns l = (Apply (FHUProj True ns) (HList l, Proxy HZero), HUnfold' (FHUProj True ns) (HList l, Proxy HZero)) Source
Complement of Projection
hProjectAwayByHNats :: (HUnfoldFD (FHUProj False ns) (ApplyR (FHUProj False ns) (t, Proxy HNat HZero)) z, Apply (FHUProj False ns) (t, Proxy HNat HZero)) => Proxy [HNat] ns -> t -> HList z Source
type HProjectAwayByHNatsCtx ns l = (Apply (FHUProj False ns) (HList l, Proxy HZero), HUnfold' (FHUProj False ns) (HList l, Proxy HZero)) Source
Splitting
hSplitByHNats :: (HUnfoldFD (FHUProj True ns) (ApplyR (FHUProj True ns) (t, Proxy HNat HZero)) z, HUnfoldFD (FHUProj False ns) (ApplyR (FHUProj False ns) (t, Proxy HNat HZero)) z1, Apply (FHUProj True ns) (t, Proxy HNat HZero), Apply (FHUProj False ns) (t, Proxy HNat HZero)) => Proxy [HNat] ns -> t -> (HList z, HList z1) Source
Splitting an array according to indices