Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type family Index (a :: k) (d :: [(k, *)]) where ...
- type family Lookup (a :: k) (d :: [(k, *)]) where ...
- type family Snoc (d :: [k]) (a :: k) where ...
- type family Last (d :: [k]) where ...
- type family Init (d :: [k]) where ...
- unsafeIndex :: forall a d f m. (KnownNat (Index a d), Coercible (f Any) (m d)) => (forall c. f c -> Int -> c) -> m d -> Lookup a d
- unsafeCons :: forall a d b f m. (Coercible (f Any) (m d), Coercible (f Any) (m ('(a, b) ': d))) => (forall c. c -> f c -> f c) -> b -> m d -> m ('(a, b) ': d)
- unsafeSnoc :: forall a d b f m. (Last d ~ '(a, b), Coercible (f Any) (m (Init d)), Coercible (f Any) (m d)) => (forall c. f c -> c -> f c) -> m (Init d) -> b -> m d
Documentation
type family Index (a :: k) (d :: [(k, *)]) where ... Source #
Index of type key a
in association list d
.
type family Lookup (a :: k) (d :: [(k, *)]) where ... Source #
Type associated with a
in d
. If the key a
occurs multiple times,
the first one is used.
unsafeIndex :: forall a d f m. (KnownNat (Index a d), Coercible (f Any) (m d)) => (forall c. f c -> Int -> c) -> m d -> Lookup a d Source #
Helper to define index
functions.