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