haskell-generate-0.2.2: haskell-generate

Safe HaskellNone

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 -> DecsQSource

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) -> DecsQSource

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

declareNamedFunction :: (Name, String) -> DecsQSource

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

declareNamedThing :: (Name, String, Name) -> DecsQSource

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).