template-haskell-2.16.0.0: Support library for Template Haskell
Safe HaskellSafe
LanguageHaskell2010

Language.Haskell.TH.Lib.Internal

Description

Language.Haskell.TH.Lib.Internal exposes some additional functionality that is used internally in GHC's integration with Template Haskell. This is not a part of the public API, and as such, there are no API guarantees for this module from version to version.

Synopsis

Type synonyms

type InfoQ = Q Info #

type PatQ = Q Pat #

type ExpQ = Q Exp #

type TExpQ a = Q (TExp a) #

type DecQ = Q Dec #

type DecsQ = Q [Dec] #

type ConQ = Q Con #

type TypeQ = Q Type #

type KindQ = Q Kind #

type TyLitQ = Q TyLit #

type CxtQ = Q Cxt #

type PredQ = Q Pred #

type MatchQ = Q Match #

type ClauseQ = Q Clause #

type BodyQ = Q Body #

type GuardQ = Q Guard #

type StmtQ = Q Stmt #

type RangeQ = Q Range #

type BangQ = Q Bang #

type Role = Role #

Lowercase pattern syntax functions

charL :: Char -> Lit #

litP :: Lit -> PatQ #

varP :: Name -> PatQ #

tupP :: [PatQ] -> PatQ #

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

infixP :: PatQ -> Name -> PatQ -> PatQ #

uInfixP :: PatQ -> Name -> PatQ -> PatQ #

asP :: Name -> PatQ -> PatQ #

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

listP :: [PatQ] -> PatQ #

sigP :: PatQ -> TypeQ -> PatQ #

viewP :: ExpQ -> PatQ -> PatQ #

Stmt

bindS :: PatQ -> ExpQ -> StmtQ #

letS :: [DecQ] -> StmtQ #

parS :: [[StmtQ]] -> StmtQ #

recS :: [StmtQ] -> StmtQ #

Range

Body

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

Guard

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

patG :: [StmtQ] -> GuardQ #

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

Match and Clause

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

Use with caseE

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

Use with funD

Exp

dyn :: String -> ExpQ #

Dynamically binding a variable (unhygenic)

varE :: Name -> ExpQ #

conE :: Name -> ExpQ #

litE :: Lit -> ExpQ #

appE :: ExpQ -> ExpQ -> ExpQ #

uInfixE :: ExpQ -> ExpQ -> ExpQ -> ExpQ #

infixApp :: ExpQ -> ExpQ -> ExpQ -> ExpQ #

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

lam1E :: PatQ -> ExpQ -> ExpQ #

Single-arg lambda

tupE :: [Maybe ExpQ] -> ExpQ #

condE :: ExpQ -> ExpQ -> ExpQ -> ExpQ #

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

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

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

doE :: [StmtQ] -> ExpQ #

mdoE :: [StmtQ] -> ExpQ #

compE :: [StmtQ] -> ExpQ #

listE :: [ExpQ] -> ExpQ #

sigE :: ExpQ -> TypeQ -> ExpQ #

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

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

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

staticE :: ExpQ -> ExpQ #

staticE x = [| static x |]

arithSeqE Shortcuts

Dec

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

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

dataD :: CxtQ -> Name -> [TyVarBndrQ] -> Maybe KindQ -> [ConQ] -> [DerivClauseQ] -> DecQ #

classD :: CxtQ -> Name -> [TyVarBndrQ] -> [FunDep] -> [DecQ] -> DecQ #

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

sigD :: Name -> TypeQ -> DecQ #

infixLD :: Int -> Name -> DecQ #

infixRD :: Int -> Name -> DecQ #

infixND :: Int -> Name -> DecQ #

patSynD :: Name -> PatSynArgsQ -> PatSynDirQ -> PatQ -> DecQ #

Pattern synonym declaration

patSynSigD :: Name -> TypeQ -> DecQ #

Pattern synonym type signature

implicitParamBindD :: String -> ExpQ -> DecQ #

Implicit parameter binding declaration. Can only be used in let and where clauses which consist entirely of implicit bindings.

cxt :: [PredQ] -> CxtQ #

infixC :: Q (Bang, Type) -> Name -> Q (Bang, Type) -> ConQ #

gadtC :: [Name] -> [StrictTypeQ] -> TypeQ -> ConQ #

Type

classP :: Name -> [Q Type] -> Q Pred #

Deprecated: As of template-haskell-2.10, constraint predicates (Pred) are just types (Type), in keeping with ConstraintKinds. Please use conT and appT.

equalP :: TypeQ -> TypeQ -> PredQ #

Deprecated: As of template-haskell-2.10, constraint predicates (Pred) are just types (Type), in keeping with ConstraintKinds. Please see equalityT.

isStrict :: Q Strict #

Deprecated: Use bang. See https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.0. Example usage: 'bang noSourceUnpackedness sourceStrict'

notStrict :: Q Strict #

Deprecated: Use bang. See https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.0. Example usage: 'bang noSourceUnpackedness noSourceStrictness'

unpacked :: Q Strict #

Deprecated: Use bang. See https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.0. Example usage: 'bang sourceUnpack sourceStrict'

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

Deprecated: As of template-haskell-2.11.0.0, StrictType has been replaced by BangType. Please use bangType instead.

varStrictType :: Name -> StrictTypeQ -> VarStrictTypeQ #

Deprecated: As of template-haskell-2.11.0.0, VarStrictType has been replaced by VarBangType. Please use varBangType instead.

Type Literals

Kind

varK :: Name -> Kind #

conK :: Name -> Kind #

appK :: Kind -> Kind -> Kind #

Type family result

Injectivity annotation

Role

Callconv

Safety

FunDep

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

RuleBndr

AnnTarget

Pattern Synonyms (sub constructs)

Useful helper function

appsE :: [ExpQ] -> ExpQ #

thisModule :: Q Module #

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