th-reify-many-0.1.2: Recurseively reify template haskell datatype info

Safe HaskellNone

Language.Haskell.TH.ReifyMany.Internal

Synopsis

Documentation

isDataDec :: Dec -> BoolSource

Returns True if the Dec is a DataD or NewtypeD

isNormalTyCon :: Dec -> BoolSource

Returns True if the Dec is a DataD, NewtypeD, or TySynD.

decToFieldTypes :: Dec -> [[Type]]Source

For data, newtype, and type declarations, yields a list of the types of the fields. In the case of a type synonyms, it just returns the body of the type synonym as a singleton list.

conToFieldTypes :: Con -> [Type]Source

Returns the types of the fields of the constructor.

typeConcreteNames :: Type -> [Name]Source

Returns the names of all type constructors which aren't involved in constraints.

decConcreteNames :: Dec -> [Name]Source

Returns the names of all type constructors used when defining type constructors.

data TypeclassInstance Source

Datatype to capture the fields of InstanceD.

Constructors

TypeclassInstance Cxt Type [Dec] 

Instances

getInstances :: Name -> Q [TypeclassInstance]Source

Given the Name of a class, yield all of the TypeclassInstances, with synonyms expanded in the Type field.

lookupInstance :: [TypeclassInstance] -> Name -> Maybe TypeclassInstanceSource

Returns the first TypeclassInstance where instanceMatches returns true.

instanceMatches :: TypeclassInstance -> Name -> BoolSource

Checks if the given name is the head of one of the paramaters of the given TypeclassInstance.

unAppsT :: Type -> [Type]Source

Breaks a type application like A b c into [A, b, c].