haskell-generate-0.2.4: Typesafe generation of haskell source code

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Generate.TH

Synopsis

Documentation

This module provides functions for automagically generating type-safe ExpG definitions from functions. For an example on how to use this, you can look at the Prelude module.

declareFunction :: Name -> DecsQ Source

Declare a function. The name of the definition will be the name of the function with an added apostrophe. (Example: declareFunction 'add generates a definition with the name add').

declareNamedSymbol :: (Name, String) -> DecsQ Source

Declare a symbol, using the given name for the definition.

declareNamedFunction :: (Name, String) -> DecsQ Source

Make a ExpG for the given function, using the given name for the definition.

declareNamedThing :: (Name, String, Name) -> DecsQ Source

Make a ExpG for some thing, using the given name for the definition. The third tuple element specifies the constructor to use for constructing the Name. This can either be 'Symbol (for symbols) or 'Ident (for functions).