template-haskell-2.8.0.0

Safe HaskellSafe-Infered

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 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 -> Q ExpSource

Dynamically binding a variable (unhygenic)

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

Callconv

Safety

FunDep

FamFlavour

RuleBndr

Useful helper function