generic-persistence-0.6.0: Database persistence using generics
Safe HaskellSafe-Inferred
LanguageGHC2021

Database.GP.TypeInfo

Synopsis

Documentation

data TypeInfo a Source #

A data type holding meta-data about a type. The Phantom type parameter a ensures type safety for reflective functions that use this type to create type instances.

typeInfo :: forall a. (HasConstructor (Rep a), HasSelectors (Rep a), Generic a) => TypeInfo a Source #

this function is a smart constructor for TypeInfo objects. It takes a value of type a and returns a `TypeInfo a` object. If the type has no named fields, an error is thrown. If the type has more than one constructor, an error is thrown.

class HasConstructor (f :: Type -> Type) where Source #

Methods

genericConstrName :: f x -> String Source #

Instances

Instances details
Constructor c => HasConstructor (C1 c f) Source # 
Instance details

Defined in Database.GP.TypeInfo

Methods

genericConstrName :: C1 c f x -> String Source #

HasConstructor f => HasConstructor (D1 c f) Source # 
Instance details

Defined in Database.GP.TypeInfo

Methods

genericConstrName :: D1 c f x -> String Source #

class HasSelectors rep where Source #

Instances

Instances details
(HasSelectors a, HasSelectors b) => HasSelectors (a :*: b :: k -> Type) Source # 
Instance details

Defined in Database.GP.TypeInfo

HasSelectors f => HasSelectors (M1 C x f :: k -> Type) Source # 
Instance details

Defined in Database.GP.TypeInfo

HasSelectors f => HasSelectors (M1 D x f :: k -> Type) Source # 
Instance details

Defined in Database.GP.TypeInfo

(Selector s, Typeable t) => HasSelectors (M1 S s (K1 R t :: k -> Type) :: k -> Type) Source # 
Instance details

Defined in Database.GP.TypeInfo