Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Datatype = Datatype {}
- data Constructor = Constructor {}
- data Fields
- = Selectors [String]
- | NoSelectors Int
- | NoFields
- class GenericDatatype (a :: * -> *) where
- class GenericConstructors (a :: * -> *) where
- getConstructors :: Proxy a -> [Constructor]
- getFields :: GenericFields a => Proxy a -> Fields
- class GenericFields (a :: * -> *) where
- getFieldsC :: Proxy a -> [Maybe String]
- getField :: forall c f. Selector c => Proxy (S1 c (Rec0 f)) -> Maybe String
Documentation
Type for meta information about ADTs.
Datatype | |
|
data Constructor Source #
Instances
Show Constructor Source # | |
Defined in Generics.Eot.Datatype showsPrec :: Int -> Constructor -> ShowS # show :: Constructor -> String # showList :: [Constructor] -> ShowS # | |
Eq Constructor Source # | |
Defined in Generics.Eot.Datatype (==) :: Constructor -> Constructor -> Bool # (/=) :: Constructor -> Constructor -> Bool # |
Type that represents meta information about fields of one constructor.
Selectors [String] | Record constructor, containing the list of the selector names. |
NoSelectors Int | Constructor with fields, but without selector names. The argument gives the number of fields. |
NoFields | Constructor without fields. |
datatype
class GenericDatatype (a :: * -> *) where Source #
Instances
(Datatype c, GenericConstructors f) => GenericDatatype (D1 c f) Source # | |
constructors
class GenericConstructors (a :: * -> *) where Source #
getConstructors :: Proxy a -> [Constructor] Source #
Instances
GenericConstructors (V1 :: Type -> Type) Source # | |
Defined in Generics.Eot.Datatype getConstructors :: Proxy V1 -> [Constructor] Source # | |
(GenericConstructors a, GenericConstructors b) => GenericConstructors (a :+: b) Source # | |
Defined in Generics.Eot.Datatype getConstructors :: Proxy (a :+: b) -> [Constructor] Source # | |
(Constructor c, GenericFields f) => GenericConstructors (C1 c f) Source # | |
Defined in Generics.Eot.Datatype getConstructors :: Proxy (C1 c f) -> [Constructor] Source # |
fields
class GenericFields (a :: * -> *) where Source #
Instances
GenericFields (U1 :: Type -> Type) Source # | |
Defined in Generics.Eot.Datatype | |
(GenericFields a, GenericFields b) => GenericFields (a :*: b) Source # | |
Defined in Generics.Eot.Datatype | |
Selector c => GenericFields (S1 c (Rec0 f)) Source # | |
Defined in Generics.Eot.Datatype |