template-haskell-2.9.0.0: Support library for Template Haskell

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.Lib

Description

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

Synopsis

Type synonyms

type InfoQ = Q Info Source

type PatQ = Q Pat Source

type FieldPatQ = Q FieldPat Source

type ExpQ = Q Exp Source

type TExpQ a = Q (TExp a) Source

type DecQ = Q Dec Source

type DecsQ = Q [Dec] Source

type ConQ = Q Con Source

type TypeQ = Q Type Source

type TyLitQ = Q TyLit Source

type CxtQ = Q Cxt Source

type PredQ = Q Pred Source

type MatchQ = Q Match Source

type ClauseQ = Q Clause Source

type BodyQ = Q Body Source

type GuardQ = Q Guard Source

type StmtQ = Q Stmt Source

type RangeQ = Q Range Source

type StrictTypeQ = Q StrictType Source

type VarStrictTypeQ = Q VarStrictType Source

type FieldExpQ = Q FieldExp Source

type RuleBndrQ = Q RuleBndr Source

type TySynEqnQ = Q TySynEqn Source

type Role = Role Source

Lowercase pattern syntax functions

intPrimL :: Integer -> Lit Source

wordPrimL :: Integer -> Lit Source

floatPrimL :: Rational -> Lit Source

doublePrimL :: Rational -> Lit Source

integerL :: Integer -> Lit Source

charL :: Char -> Lit Source

stringL :: String -> Lit Source

stringPrimL :: [Word8] -> Lit Source

rationalL :: Rational -> Lit Source

litP :: Lit -> PatQ Source

varP :: Name -> PatQ Source

tupP :: [PatQ] -> PatQ Source

unboxedTupP :: [PatQ] -> PatQ Source

conP :: Name -> [PatQ] -> PatQ Source

infixP :: PatQ -> Name -> PatQ -> PatQ Source

uInfixP :: PatQ -> Name -> PatQ -> PatQ Source

parensP :: PatQ -> PatQ Source

tildeP :: PatQ -> PatQ Source

bangP :: PatQ -> PatQ Source

asP :: Name -> PatQ -> PatQ Source

wildP :: PatQ Source

recP :: Name -> [FieldPatQ] -> PatQ Source

listP :: [PatQ] -> PatQ Source

sigP :: PatQ -> TypeQ -> PatQ Source

viewP :: ExpQ -> PatQ -> PatQ Source

fieldPat :: Name -> PatQ -> FieldPatQ Source

Stmt

bindS :: PatQ -> ExpQ -> StmtQ Source

letS :: [DecQ] -> StmtQ Source

noBindS :: ExpQ -> StmtQ Source

parS :: [[StmtQ]] -> StmtQ Source

Range

fromR :: ExpQ -> RangeQ Source

fromThenR :: ExpQ -> ExpQ -> RangeQ Source

fromToR :: ExpQ -> ExpQ -> RangeQ Source

fromThenToR :: ExpQ -> ExpQ -> ExpQ -> RangeQ Source

Body

normalB :: ExpQ -> BodyQ Source

guardedB :: [Q (Guard, Exp)] -> BodyQ Source

Guard

normalG :: ExpQ -> GuardQ Source

normalGE :: ExpQ -> ExpQ -> Q (Guard, Exp) Source

patG :: [StmtQ] -> GuardQ Source

patGE :: [StmtQ] -> ExpQ -> Q (Guard, Exp) Source

Match and Clause

match :: PatQ -> BodyQ -> [DecQ] -> MatchQ Source

Use with caseE

clause :: [PatQ] -> BodyQ -> [DecQ] -> ClauseQ Source

Use with funD

Exp

dyn :: String -> ExpQ Source

Dynamically binding a variable (unhygenic)

global :: Name -> ExpQ Source

Deprecated: Use varE instead

varE :: Name -> ExpQ Source

conE :: Name -> ExpQ Source

litE :: Lit -> ExpQ Source

appE :: ExpQ -> ExpQ -> ExpQ Source

parensE :: ExpQ -> ExpQ Source

uInfixE :: ExpQ -> ExpQ -> ExpQ -> ExpQ Source

infixE :: Maybe ExpQ -> ExpQ -> Maybe ExpQ -> ExpQ Source

infixApp :: ExpQ -> ExpQ -> ExpQ -> ExpQ Source

sectionL :: ExpQ -> ExpQ -> ExpQ Source

sectionR :: ExpQ -> ExpQ -> ExpQ Source

lamE :: [PatQ] -> ExpQ -> ExpQ Source

lam1E :: PatQ -> ExpQ -> ExpQ Source

Single-arg lambda

lamCaseE :: [MatchQ] -> ExpQ Source

tupE :: [ExpQ] -> ExpQ Source

unboxedTupE :: [ExpQ] -> ExpQ Source

condE :: ExpQ -> ExpQ -> ExpQ -> ExpQ Source

multiIfE :: [Q (Guard, Exp)] -> ExpQ Source

letE :: [DecQ] -> ExpQ -> ExpQ Source

caseE :: ExpQ -> [MatchQ] -> ExpQ Source

doE :: [StmtQ] -> ExpQ Source

compE :: [StmtQ] -> ExpQ Source

arithSeqE :: RangeQ -> ExpQ Source

listE :: [ExpQ] -> ExpQ Source

sigE :: ExpQ -> TypeQ -> ExpQ Source

recConE :: Name -> [Q (Name, Exp)] -> ExpQ Source

recUpdE :: ExpQ -> [Q (Name, Exp)] -> ExpQ Source

stringE :: String -> ExpQ Source

fieldExp :: Name -> ExpQ -> Q (Name, Exp) Source

arithSeqE Shortcuts

fromE :: ExpQ -> ExpQ Source

fromThenE :: ExpQ -> ExpQ -> ExpQ Source

fromToE :: ExpQ -> ExpQ -> ExpQ Source

fromThenToE :: ExpQ -> ExpQ -> ExpQ -> ExpQ Source

Dec

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

funD :: Name -> [ClauseQ] -> DecQ Source

tySynD :: Name -> [TyVarBndr] -> TypeQ -> DecQ Source

dataD :: CxtQ -> Name -> [TyVarBndr] -> [ConQ] -> [Name] -> DecQ Source

newtypeD :: CxtQ -> Name -> [TyVarBndr] -> ConQ -> [Name] -> DecQ Source

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

instanceD :: CxtQ -> TypeQ -> [DecQ] -> DecQ Source

sigD :: Name -> TypeQ -> DecQ Source

forImpD :: Callconv -> Safety -> String -> Name -> TypeQ -> DecQ Source

infixLD :: Int -> Name -> DecQ Source

infixRD :: Int -> Name -> DecQ Source

infixND :: Int -> Name -> DecQ Source

pragInlD :: Name -> Inline -> RuleMatch -> Phases -> DecQ Source

pragSpecD :: Name -> TypeQ -> Phases -> DecQ Source

pragSpecInlD :: Name -> TypeQ -> Inline -> Phases -> DecQ Source

pragSpecInstD :: TypeQ -> DecQ Source

pragRuleD :: String -> [RuleBndrQ] -> ExpQ -> ExpQ -> Phases -> DecQ Source

pragAnnD :: AnnTarget -> ExpQ -> DecQ Source

familyNoKindD :: FamFlavour -> Name -> [TyVarBndr] -> DecQ Source

familyKindD :: FamFlavour -> Name -> [TyVarBndr] -> Kind -> DecQ Source

dataInstD :: CxtQ -> Name -> [TypeQ] -> [ConQ] -> [Name] -> DecQ Source

newtypeInstD :: CxtQ -> Name -> [TypeQ] -> ConQ -> [Name] -> DecQ Source

tySynInstD :: Name -> TySynEqnQ -> DecQ Source

closedTypeFamilyNoKindD :: Name -> [TyVarBndr] -> [TySynEqnQ] -> DecQ Source

closedTypeFamilyKindD :: Name -> [TyVarBndr] -> Kind -> [TySynEqnQ] -> DecQ Source

roleAnnotD :: Name -> [Role] -> DecQ Source

tySynEqn :: [TypeQ] -> TypeQ -> TySynEqnQ Source

cxt :: [PredQ] -> CxtQ Source

classP :: Name -> [TypeQ] -> PredQ Source

equalP :: TypeQ -> TypeQ -> PredQ Source

normalC :: Name -> [StrictTypeQ] -> ConQ Source

recC :: Name -> [VarStrictTypeQ] -> ConQ Source

infixC :: Q (Strict, Type) -> Name -> Q (Strict, Type) -> ConQ Source

forallC :: [TyVarBndr] -> CxtQ -> ConQ -> ConQ Source

Type

forallT :: [TyVarBndr] -> CxtQ -> TypeQ -> TypeQ Source

varT :: Name -> TypeQ Source

conT :: Name -> TypeQ Source

appT :: TypeQ -> TypeQ -> TypeQ Source

arrowT :: TypeQ Source

listT :: TypeQ Source

litT :: TyLitQ -> TypeQ Source

tupleT :: Int -> TypeQ Source

unboxedTupleT :: Int -> TypeQ Source

sigT :: TypeQ -> Kind -> TypeQ Source

promotedT :: Name -> TypeQ Source

promotedTupleT :: Int -> TypeQ Source

promotedNilT :: TypeQ Source

promotedConsT :: TypeQ Source

isStrict :: Q Strict Source

unpacked :: Q Strict Source

notStrict :: Q Strict Source

strictType :: Q Strict -> TypeQ -> StrictTypeQ Source

varStrictType :: Name -> StrictTypeQ -> VarStrictTypeQ Source

Type Literals

numTyLit :: Integer -> TyLitQ Source

strTyLit :: String -> TyLitQ Source

Kind

plainTV :: Name -> TyVarBndr Source

kindedTV :: Name -> Kind -> TyVarBndr Source

varK :: Name -> Kind Source

conK :: Name -> Kind Source

tupleK :: Int -> Kind Source

arrowK :: Kind Source

listK :: Kind Source

appK :: Kind -> Kind -> Kind Source

starK :: Kind Source

constraintK :: Kind Source

Role

nominalR :: Role Source

inferR :: Role Source

phantomR :: Role Source

representationalR :: Role Source

Callconv

cCall :: Callconv Source

stdCall :: Callconv Source

Safety

unsafe :: Safety Source

interruptible :: Safety Source

safe :: Safety Source

FunDep

funDep :: [Name] -> [Name] -> FunDep Source

FamFlavour

typeFam :: FamFlavour Source

dataFam :: FamFlavour Source

RuleBndr

ruleVar :: Name -> RuleBndrQ Source

typedRuleVar :: Name -> TypeQ -> RuleBndrQ Source

Useful helper function

appsE :: [ExpQ] -> ExpQ Source

thisModule :: Q Module Source

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

AltStyle によって変換されたページ (->オリジナル) /