template-haskell-natural-1.0.0.0
Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.Natural.Syntax.Datatype.Data

Description

Builder for data type declaration

Synopsis

Type

newData :: String -> DataBuilder () -> Q DataD Source #

Builds a new data type declaration. The first argument is the name of the data type.

Functions

addCon :: GenCon b => b -> DataBuilder () Source #

Add a constructor to the data type

addDeriving :: Name -> DataBuilder () Source #

Add a deriving clause using the Name of the typeclass to derive

  addDeriving 'Show

Reexports

addContext :: forall {k} s a (step :: k). HasCxt s [a] => Q a -> Builder s step step () Source #

Add a constraint to a context

addTypeVar :: forall {k} s (step :: k). HasTyVarBndr s [TyVarBndr BndrVis] => TypeVarName -> Builder s step step () Source #

Add the type variable to the tyVarBndr list

addTypeVar' :: forall {k} s vis (step :: k). HasTyVarBndr s [TyVarBndr vis] => TypeVarName -> vis -> Maybe Kind -> Builder s step step () Source #

Same as addTypeVar, but allows setting the kind and vis of the type variable