Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generics
Synopsis
- module GHC.Generics
- data Field (name :: Symbol) (t :: *)
- type family FieldType f where ...
- type family LookupField (fs :: [*]) (s :: Symbol) where ...
- type family LookupFieldType fs s where ...
- type family ExtractFields (a :: *) where ...
- type family ExtractFieldTypes (a :: *) where ...
Documentation
module GHC.Generics
Fields
type family LookupField (fs :: [*]) (s :: Symbol) where ... Source #
LookupField (Field name t ': fs) name = Field name t | |
LookupField (Field name t ': fs) s = LookupField fs s | |
LookupField '[] name = TypeError ('Text "Cannot find field with name: " :<>: 'ShowType name) |
type family LookupFieldType fs s where ... Source #
LookupFieldType fs s = FieldType (LookupField fs s) |
Data type fields
type family ExtractFields (a :: *) where ... Source #
Extract fields of a data type: - require selector symbols - only support data type with a single constructor
ExtractFields a = ExtractFields' (Rep a) |
type family ExtractFieldTypes (a :: *) where ... Source #
Extract types of the fields of a data type - only support data type with a single constructor
ExtractFieldTypes a = ExtractFieldTypes' (Rep a) |