template-haskell-2.9.0.0: Support library for Template Haskell

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.Lib

Contents

Description

TH.Lib contains lots of useful helper functions for generating and manipulating Template Haskell terms

Synopsis

Type synonyms

type TExpQ a = Q (TExp a)Source

type DecsQ = Q [Dec]Source

Lowercase pattern syntax functions

Stmt

Range

Body

Guard

Match and Clause

match :: PatQ -> BodyQ -> [DecQ] -> MatchQSource

Use with caseE

clause :: [PatQ] -> BodyQ -> [DecQ] -> ClauseQSource

Use with funD

Exp

dyn :: String -> ExpQSource

Dynamically binding a variable (unhygenic)

global :: Name -> ExpQSource

Deprecated: Use varE instead

lam1E :: PatQ -> ExpQ -> ExpQSource

Single-arg lambda

arithSeqE Shortcuts

Dec

valD :: PatQ -> BodyQ -> [DecQ] -> DecQSource

dataD :: CxtQ -> Name -> [TyVarBndr] -> [ConQ] -> [Name] -> DecQSource

classD :: CxtQ -> Name -> [TyVarBndr] -> [FunDep] -> [DecQ] -> DecQSource

dataInstD :: CxtQ -> Name -> [TypeQ] -> [ConQ] -> [Name] -> DecQSource

Type

Type Literals

Kind

Role

Callconv

Safety

FunDep

FamFlavour

RuleBndr

Useful helper function

thisModule :: Q ModuleSource

Return the Module at the place of splicing. Can be used as an input for reifyModule.