Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype Labeled sym a = Labeled {
- unLabeled :: a
- data Elem (a :: k) (as :: [k]) where
- type family IndexList (n :: Nat) (l :: [k]) :: k where ...
- type family IndexLabel name as where ...
- type family SingleItem (as :: [k]) :: k where ...
- type family Drop (n :: Nat) (as :: [k]) :: [k] where ...
Documentation
data Elem (a :: k) (as :: [k]) where Source #
GADT proof-witness of HList membership, usable as an index
type family IndexLabel name as where ... Source #
Indexing list of labeled pairs by label
IndexLabel name '[] = TypeError ((('Text "Invalid field name `" ':<>: 'Text name) ':<>: 'Text "`") ':$$: 'Text "Consider adding it to `pletFields` list") | |
IndexLabel name ('(name, a) ': _) = a | |
IndexLabel name (_ ': as) = IndexLabel name as |
type family SingleItem (as :: [k]) :: k where ... Source #
Return the single item from a singleton list
SingleItem '[a] = a |