ghc-definitions-th-0.1: Automatically generate GHC API counterparts to Haskell declarations.
Safe HaskellNone




makeDefinitions :: [Name] -> Q [Dec] Source #

Given a list of names names, makeDefinitions constructs the following:

  1. A constraint Definitions.
  2. A function findDefinitions ∷ TcPluginM (Dict Definitions)
  3. For each name ∈ names, a function name⟨type⟩ ∷ Definitions ⇒ ⟨type⟩, where ⟨type⟩ is determined by whatever name refers to, i.e. a data constructor (DataCon), function or value (Var), or type constructor (TyCon).

makeDefinitionsWithConfig :: Config -> [Name] -> Q [Dec] Source #

Like makeDefinitions, but allows some control over the generated names.

makePattern :: String -> Name -> Q [Dec] Source #

Constructs a pattern synonym for a given TyCon, DataCon, or Var.