GHC.Internal.TH.Lib

ghc-internal-9.1400.0: Basic libraries

Safe Haskell | Trustworthy
Language | Haskell2010

GHC.Internal.TH.Lib

Contents

- Type synonyms
- Lowercase pattern syntax functions
- Stmt
- Range
- Body
- Guard
- Match and Clause
- Exp
  - `arithSeqE` Shortcuts
- Dec
- Type
- Type Literals
- Kind
- Type family result
- Injectivity annotation
- Role
- Callconv
- Safety
- FunDep
- RuleBndr
- AnnTarget
- Pattern Synonyms (sub constructs)
- Useful helper function
- Documentation combinators

Description

GHC.Internal.TH.Lib 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 TExpQ (a :: TYPE r) = Q (TExp a)
- type CodeQ = Code Q
- type InfoQ = Q Info
- type PatQ = Q Pat
- type FieldPatQ = Q FieldPat
- type ExpQ = Q Exp
- type DecQ = Q Dec
- type DecsQ = Q [Dec]
- type Decs = [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 DerivClauseQ = Q DerivClause
- 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 SourceStrictnessQ = Q SourceStrictness
- type SourceUnpackednessQ = Q SourceUnpackedness
- type BangQ = Q Bang
- type BangTypeQ = Q BangType
- type VarBangTypeQ = Q VarBangType
- type StrictTypeQ = Q StrictType
- type VarStrictTypeQ = Q VarStrictType
- type FieldExpQ = Q FieldExp
- type RuleBndrQ = Q RuleBndr
- type TySynEqnQ = Q TySynEqn
- type PatSynDirQ = Q PatSynDir
- type PatSynArgsQ = Q PatSynArgs
- type FamilyResultSigQ = Q FamilyResultSig
- type DerivStrategyQ = Q DerivStrategy
- type Role = Role
- type InjectivityAnn = InjectivityAnn
- type TyVarBndrUnit = TyVarBndr ()
- type TyVarBndrSpec = TyVarBndr Specificity
- type TyVarBndrVis = TyVarBndr BndrVis
- intPrimL :: Integer -> Lit
- wordPrimL :: Integer -> Lit
- floatPrimL :: Rational -> Lit
- doublePrimL :: Rational -> Lit
- integerL :: Integer -> Lit
- charL :: Char -> Lit
- charPrimL :: Char -> Lit
- stringL :: String -> Lit
- stringPrimL :: [Word8] -> Lit
- bytesPrimL :: Bytes -> Lit
- rationalL :: Rational -> Lit
- litP :: Quote m => Lit -> m Pat
- varP :: Quote m => Name -> m Pat
- tupP :: Quote m => [m Pat] -> m Pat
- unboxedTupP :: Quote m => [m Pat] -> m Pat
- unboxedSumP :: Quote m => m Pat -> SumAlt -> SumArity -> m Pat
- conP :: Quote m => Name -> [m Type] -> [m Pat] -> m Pat
- infixP :: Quote m => m Pat -> Name -> m Pat -> m Pat
- uInfixP :: Quote m => m Pat -> Name -> m Pat -> m Pat
- parensP :: Quote m => m Pat -> m Pat
- tildeP :: Quote m => m Pat -> m Pat
- bangP :: Quote m => m Pat -> m Pat
- asP :: Quote m => Name -> m Pat -> m Pat
- wildP :: Quote m => m Pat
- recP :: Quote m => Name -> [m FieldPat] -> m Pat
- listP :: Quote m => [m Pat] -> m Pat
- sigP :: Quote m => m Pat -> m Type -> m Pat
- typeP :: Quote m => m Type -> m Pat
- invisP :: Quote m => m Type -> m Pat
- viewP :: Quote m => m Exp -> m Pat -> m Pat
- orP :: Quote m => NonEmpty (m Pat) -> m Pat
- fieldPat :: Quote m => Name -> m Pat -> m FieldPat
- bindS :: Quote m => m Pat -> m Exp -> m Stmt
- letS :: Quote m => [m Dec] -> m Stmt
- noBindS :: Quote m => m Exp -> m Stmt
- parS :: Quote m => [[m Stmt]] -> m Stmt
- recS :: Quote m => [m Stmt] -> m Stmt
- fromR :: Quote m => m Exp -> m Range
- fromThenR :: Quote m => m Exp -> m Exp -> m Range
- fromToR :: Quote m => m Exp -> m Exp -> m Range
- fromThenToR :: Quote m => m Exp -> m Exp -> m Exp -> m Range
- normalB :: Quote m => m Exp -> m Body
- guardedB :: Quote m => [m (Guard, Exp)] -> m Body
- normalG :: Quote m => m Exp -> m Guard
- normalGE :: Quote m => m Exp -> m Exp -> m (Guard, Exp)
- patG :: Quote m => [m Stmt] -> m Guard
- patGE :: Quote m => [m Stmt] -> m Exp -> m (Guard, Exp)
- match :: Quote m => m Pat -> m Body -> [m Dec] -> m Match
- clause :: Quote m => [m Pat] -> m Body -> [m Dec] -> m Clause
- dyn :: Quote m => String -> m Exp
- varE :: Quote m => Name -> m Exp
- conE :: Quote m => Name -> m Exp
- litE :: Quote m => Lit -> m Exp
- appE :: Quote m => m Exp -> m Exp -> m Exp
- appTypeE :: Quote m => m Exp -> m Type -> m Exp
- parensE :: Quote m => m Exp -> m Exp
- uInfixE :: Quote m => m Exp -> m Exp -> m Exp -> m Exp
- infixE :: Quote m => Maybe (m Exp) -> m Exp -> Maybe (m Exp) -> m Exp
- infixApp :: Quote m => m Exp -> m Exp -> m Exp -> m Exp
- sectionL :: Quote m => m Exp -> m Exp -> m Exp
- sectionR :: Quote m => m Exp -> m Exp -> m Exp
- lamE :: Quote m => [m Pat] -> m Exp -> m Exp
- lam1E :: Quote m => m Pat -> m Exp -> m Exp
- lamCaseE :: Quote m => [m Match] -> m Exp
- lamCasesE :: Quote m => [m Clause] -> m Exp
- tupE :: Quote m => [Maybe (m Exp)] -> m Exp
- unboxedTupE :: Quote m => [Maybe (m Exp)] -> m Exp
- unboxedSumE :: Quote m => m Exp -> SumAlt -> SumArity -> m Exp
- condE :: Quote m => m Exp -> m Exp -> m Exp -> m Exp
- multiIfE :: Quote m => [m (Guard, Exp)] -> m Exp
- letE :: Quote m => [m Dec] -> m Exp -> m Exp
- caseE :: Quote m => m Exp -> [m Match] -> m Exp
- doE :: Quote m => Maybe ModName -> [m Stmt] -> m Exp
- mdoE :: Quote m => Maybe ModName -> [m Stmt] -> m Exp
- compE :: Quote m => [m Stmt] -> m Exp
- arithSeqE :: Quote m => m Range -> m Exp
- listE :: Quote m => [m Exp] -> m Exp
- sigE :: Quote m => m Exp -> m Type -> m Exp
- recConE :: Quote m => Name -> [m (Name, Exp)] -> m Exp
- recUpdE :: Quote m => m Exp -> [m (Name, Exp)] -> m Exp
- stringE :: Quote m => String -> m Exp
- fieldExp :: Quote m => Name -> m Exp -> m (Name, Exp)
- staticE :: Quote m => m Exp -> m Exp
- unboundVarE :: Quote m => Name -> m Exp
- labelE :: Quote m => String -> m Exp
- implicitParamVarE :: Quote m => String -> m Exp
- getFieldE :: Quote m => m Exp -> String -> m Exp
- projectionE :: Quote m => NonEmpty String -> m Exp
- typedSpliceE :: Quote m => m Exp -> m Exp
- typedBracketE :: Quote m => m Exp -> m Exp
- fromE :: Quote m => m Exp -> m Exp
- fromThenE :: Quote m => m Exp -> m Exp -> m Exp
- fromToE :: Quote m => m Exp -> m Exp -> m Exp
- fromThenToE :: Quote m => m Exp -> m Exp -> m Exp -> m Exp
- typeE :: Quote m => m Type -> m Exp
- forallE :: Quote m => [m (TyVarBndr Specificity)] -> m Exp -> m Exp
- forallVisE :: Quote m => [m (TyVarBndr ())] -> m Exp -> m Exp
- constrainedE :: Quote m => [m Exp] -> m Exp -> m Exp
- valD :: Quote m => m Pat -> m Body -> [m Dec] -> m Dec
- funD :: Quote m => Name -> [m Clause] -> m Dec
- tySynD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> m Type -> m Dec
- dataD :: Quote m => m Cxt -> Name -> [m (TyVarBndr BndrVis)] -> Maybe (m Kind) -> [m Con] -> [m DerivClause] -> m Dec
- newtypeD :: Quote m => m Cxt -> Name -> [m (TyVarBndr BndrVis)] -> Maybe (m Kind) -> m Con -> [m DerivClause] -> m Dec
- typeDataD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> Maybe (m Kind) -> [m Con] -> m Dec
- classD :: Quote m => m Cxt -> Name -> [m (TyVarBndr BndrVis)] -> [FunDep] -> [m Dec] -> m Dec
- instanceD :: Quote m => m Cxt -> m Type -> [m Dec] -> m Dec
- instanceWithOverlapD :: Quote m => Maybe Overlap -> m Cxt -> m Type -> [m Dec] -> m Dec
- sigD :: Quote m => Name -> m Type -> m Dec
- kiSigD :: Quote m => Name -> m Kind -> m Dec
- forImpD :: Quote m => Callconv -> Safety -> String -> Name -> m Type -> m Dec
- infixLD :: Quote m => Int -> Name -> m Dec
- infixRD :: Quote m => Int -> Name -> m Dec
- infixND :: Quote m => Int -> Name -> m Dec
- infixLWithSpecD :: Quote m => Int -> NamespaceSpecifier -> Name -> m Dec
- infixRWithSpecD :: Quote m => Int -> NamespaceSpecifier -> Name -> m Dec
- infixNWithSpecD :: Quote m => Int -> NamespaceSpecifier -> Name -> m Dec
- defaultD :: Quote m => [m Type] -> m Dec
- pragInlD :: Quote m => Name -> Inline -> RuleMatch -> Phases -> m Dec
- pragOpaqueD :: Quote m => Name -> m Dec
- pragSpecED :: Quote m => Maybe [m (TyVarBndr ())] -> [m RuleBndr] -> m Exp -> Phases -> m Dec
- pragSpecInlED :: Quote m => Maybe [m (TyVarBndr ())] -> [m RuleBndr] -> m Exp -> Inline -> Phases -> m Dec
- pragSpecInstD :: Quote m => m Type -> m Dec
- pragRuleD :: Quote m => String -> Maybe [m (TyVarBndr ())] -> [m RuleBndr] -> m Exp -> m Exp -> Phases -> m Dec
- pragAnnD :: Quote m => AnnTarget -> m Exp -> m Dec
- pragLineD :: Quote m => Int -> String -> m Dec
- pragCompleteD :: Quote m => [Name] -> Maybe Name -> m Dec
- pragSCCFunD :: Quote m => Name -> m Dec
- pragSCCFunNamedD :: Quote m => Name -> String -> m Dec
- dataInstD :: Quote m => m Cxt -> Maybe [m (TyVarBndr ())] -> m Type -> Maybe (m Kind) -> [m Con] -> [m DerivClause] -> m Dec
- newtypeInstD :: Quote m => m Cxt -> Maybe [m (TyVarBndr ())] -> m Type -> Maybe (m Kind) -> m Con -> [m DerivClause] -> m Dec
- tySynInstD :: Quote m => m TySynEqn -> m Dec
- dataFamilyD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> Maybe (m Kind) -> m Dec
- openTypeFamilyD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> m FamilyResultSig -> Maybe InjectivityAnn -> m Dec
- closedTypeFamilyD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> m FamilyResultSig -> Maybe InjectivityAnn -> [m TySynEqn] -> m Dec
- roleAnnotD :: Quote m => Name -> [Role] -> m Dec
- standaloneDerivD :: Quote m => m Cxt -> m Type -> m Dec
- standaloneDerivWithStrategyD :: Quote m => Maybe (m DerivStrategy) -> m Cxt -> m Type -> m Dec
- defaultSigD :: Quote m => Name -> m Type -> m Dec
- patSynD :: Quote m => Name -> m PatSynArgs -> m PatSynDir -> m Pat -> m Dec
- patSynSigD :: Quote m => Name -> m Type -> m Dec
- implicitParamBindD :: Quote m => String -> m Exp -> m Dec
- tySynEqn :: Quote m => Maybe [m (TyVarBndr ())] -> m Type -> m Type -> m TySynEqn
- cxt :: Quote m => [m Pred] -> m Cxt
- derivClause :: Quote m => Maybe (m DerivStrategy) -> [m Pred] -> m DerivClause
- stockStrategy :: Quote m => m DerivStrategy
- anyclassStrategy :: Quote m => m DerivStrategy
- newtypeStrategy :: Quote m => m DerivStrategy
- viaStrategy :: Quote m => m Type -> m DerivStrategy
- normalC :: Quote m => Name -> [m BangType] -> m Con
- recC :: Quote m => Name -> [m VarBangType] -> m Con
- infixC :: Quote m => m (Bang, Type) -> Name -> m (Bang, Type) -> m Con
- forallC :: Quote m => [m (TyVarBndr Specificity)] -> m Cxt -> m Con -> m Con
- gadtC :: Quote m => [Name] -> [m StrictType] -> m Type -> m Con
- recGadtC :: Quote m => [Name] -> [m VarStrictType] -> m Type -> m Con
- forallT :: Quote m => [m (TyVarBndr Specificity)] -> m Cxt -> m Type -> m Type
- forallVisT :: Quote m => [m (TyVarBndr ())] -> m Type -> m Type
- varT :: Quote m => Name -> m Type
- conT :: Quote m => Name -> m Type
- infixT :: Quote m => m Type -> Name -> m Type -> m Type
- uInfixT :: Quote m => m Type -> Name -> m Type -> m Type
- promotedInfixT :: Quote m => m Type -> Name -> m Type -> m Type
- promotedUInfixT :: Quote m => m Type -> Name -> m Type -> m Type
- parensT :: Quote m => m Type -> m Type
- appT :: Quote m => m Type -> m Type -> m Type
- appKindT :: Quote m => m Type -> m Kind -> m Type
- arrowT :: Quote m => m Type
- mulArrowT :: Quote m => m Type
- listT :: Quote m => m Type
- litT :: Quote m => m TyLit -> m Type
- tupleT :: Quote m => Int -> m Type
- unboxedTupleT :: Quote m => Int -> m Type
- unboxedSumT :: Quote m => SumArity -> m Type
- sigT :: Quote m => m Type -> m Kind -> m Type
- equalityT :: Quote m => m Type
- wildCardT :: Quote m => m Type
- implicitParamT :: Quote m => String -> m Type -> m Type
- promotedT :: Quote m => Name -> m Type
- promotedTupleT :: Quote m => Int -> m Type
- promotedNilT :: Quote m => m Type
- promotedConsT :: Quote m => m Type
- noSourceUnpackedness :: Quote m => m SourceUnpackedness
- sourceNoUnpack :: Quote m => m SourceUnpackedness
- sourceUnpack :: Quote m => m SourceUnpackedness
- noSourceStrictness :: Quote m => m SourceStrictness
- sourceLazy :: Quote m => m SourceStrictness
- sourceStrict :: Quote m => m SourceStrictness
- bang :: Quote m => m SourceUnpackedness -> m SourceStrictness -> m Bang
- bangType :: Quote m => m Bang -> m Type -> m BangType
- varBangType :: Quote m => Name -> m BangType -> m VarBangType
- numTyLit :: Quote m => Integer -> m TyLit
- strTyLit :: Quote m => String -> m TyLit
- charTyLit :: Quote m => Char -> m TyLit
- plainTV :: Quote m => Name -> m (TyVarBndr ())
- plainInvisTV :: Quote m => Name -> Specificity -> m (TyVarBndr Specificity)
- plainBndrTV :: Quote m => Name -> BndrVis -> m (TyVarBndr BndrVis)
- kindedTV :: Quote m => Name -> m Kind -> m (TyVarBndr ())
- kindedInvisTV :: Quote m => Name -> Specificity -> m Kind -> m (TyVarBndr Specificity)
- kindedBndrTV :: Quote m => Name -> BndrVis -> m Kind -> m (TyVarBndr BndrVis)
- specifiedSpec :: Specificity
- inferredSpec :: Specificity
- bndrReq :: BndrVis
- bndrInvis :: BndrVis
- varK :: Name -> Kind
- conK :: Name -> Kind
- tupleK :: Int -> Kind
- arrowK :: Kind
- listK :: Kind
- appK :: Kind -> Kind -> Kind
- starK :: Quote m => m Kind
- constraintK :: Quote m => m Kind
- noSig :: Quote m => m FamilyResultSig
- kindSig :: Quote m => m Kind -> m FamilyResultSig
- tyVarSig :: Quote m => m (TyVarBndr ()) -> m FamilyResultSig
- injectivityAnn :: Name -> [Name] -> InjectivityAnn
- nominalR :: Role
- representationalR :: Role
- phantomR :: Role
- inferR :: Role
- cCall :: Callconv
- stdCall :: Callconv
- cApi :: Callconv
- prim :: Callconv
- javaScript :: Callconv
- unsafe :: Safety
- safe :: Safety
- interruptible :: Safety
- funDep :: [Name] -> [Name] -> FunDep
- ruleVar :: Quote m => Name -> m RuleBndr
- typedRuleVar :: Quote m => Name -> m Type -> m RuleBndr
- valueAnnotation :: Name -> AnnTarget
- typeAnnotation :: Name -> AnnTarget
- moduleAnnotation :: AnnTarget
- unidir :: Quote m => m PatSynDir
- implBidir :: Quote m => m PatSynDir
- explBidir :: Quote m => [m Clause] -> m PatSynDir
- prefixPatSyn :: Quote m => [Name] -> m PatSynArgs
- recordPatSyn :: Quote m => [Name] -> m PatSynArgs
- infixPatSyn :: Quote m => Name -> Name -> m PatSynArgs
- appsE :: Quote m => [m Exp] -> m Exp
- thisModule :: Q Module
- withDecDoc :: String -> Q Dec -> Q Dec
- withDecsDoc :: String -> Q [Dec] -> Q [Dec]
- funD_doc :: Name -> [Q Clause] -> Maybe String -> [Maybe String] -> Q Dec
- dataD_doc :: Q Cxt -> Name -> [Q (TyVarBndr BndrVis)] -> Maybe (Q Kind) -> [(Q Con, Maybe String, [Maybe String])] -> [Q DerivClause] -> Maybe String -> Q Dec
- newtypeD_doc :: Q Cxt -> Name -> [Q (TyVarBndr BndrVis)] -> Maybe (Q Kind) -> (Q Con, Maybe String, [Maybe String]) -> [Q DerivClause] -> Maybe String -> Q Dec
- typeDataD_doc :: Name -> [Q (TyVarBndr BndrVis)] -> Maybe (Q Kind) -> [(Q Con, Maybe String, [Maybe String])] -> Maybe String -> Q Dec
- dataInstD_doc :: Q Cxt -> Maybe [Q (TyVarBndr ())] -> Q Type -> Maybe (Q Kind) -> [(Q Con, Maybe String, [Maybe String])] -> [Q DerivClause] -> Maybe String -> Q Dec
- newtypeInstD_doc :: Q Cxt -> Maybe [Q (TyVarBndr ())] -> Q Type -> Maybe (Q Kind) -> (Q Con, Maybe String, [Maybe String]) -> [Q DerivClause] -> Maybe String -> Q Dec
- patSynD_doc :: Name -> Q PatSynArgs -> Q PatSynDir -> Q Pat -> Maybe String -> [Maybe String] -> Q Dec
- docCons :: (Q Con, Maybe String, [Maybe String]) -> Q ()

# Type synonyms

type TExpQ (a :: TYPE r) = Q (TExp a) Source #

Representation-polymorphic since template-haskell-2.17.0.0.

type CodeQ = Code Q Source #

type InfoQ = Q Info Source #

type PatQ = Q Pat Source #

type FieldPatQ = Q FieldPat Source #

type ExpQ = Q Exp Source #

type DecQ = Q Dec Source #

type DecsQ = Q [Dec] Source #

type Decs = [Dec] Source #

type ConQ = Q Con Source #

type TypeQ = Q Type Source #

type KindQ = Q Kind Source #

type TyLitQ = Q TyLit Source #

type CxtQ = Q Cxt Source #

type PredQ = Q Pred Source #

type DerivClauseQ = Q DerivClause 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 SourceStrictnessQ = Q SourceStrictness Source #

type SourceUnpackednessQ = Q SourceUnpackedness Source #

type BangQ = Q Bang Source #

type BangTypeQ = Q BangType Source #

type VarBangTypeQ = Q VarBangType 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 PatSynDirQ = Q PatSynDir Source #

type PatSynArgsQ = Q PatSynArgs Source #

type FamilyResultSigQ = Q FamilyResultSig Source #

type DerivStrategyQ = Q DerivStrategy Source #

type Role = Role Source #

type InjectivityAnn = InjectivityAnn Source #

type TyVarBndrUnit = TyVarBndr () Source #

type TyVarBndrSpec = TyVarBndr Specificity Source #

type TyVarBndrVis = TyVarBndr BndrVis 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 #

charPrimL :: Char -> Lit Source #

stringL :: String -> Lit Source #

stringPrimL :: [Word8] -> Lit Source #

bytesPrimL :: Bytes -> Lit Source #

rationalL :: Rational -> Lit Source #

litP :: Quote m => Lit -> m Pat Source #

varP :: Quote m => Name -> m Pat Source #

tupP :: Quote m => [m Pat] -> m Pat Source #

unboxedTupP :: Quote m => [m Pat] -> m Pat Source #

unboxedSumP :: Quote m => m Pat -> SumAlt -> SumArity -> m Pat Source #

conP :: Quote m => Name -> [m Type] -> [m Pat] -> m Pat Source #

infixP :: Quote m => m Pat -> Name -> m Pat -> m Pat Source #

uInfixP :: Quote m => m Pat -> Name -> m Pat -> m Pat Source #

parensP :: Quote m => m Pat -> m Pat Source #

tildeP :: Quote m => m Pat -> m Pat Source #

bangP :: Quote m => m Pat -> m Pat Source #

asP :: Quote m => Name -> m Pat -> m Pat Source #

wildP :: Quote m => m Pat Source #

recP :: Quote m => Name -> [m FieldPat] -> m Pat Source #

listP :: Quote m => [m Pat] -> m Pat Source #

sigP :: Quote m => m Pat -> m Type -> m Pat Source #

typeP :: Quote m => m Type -> m Pat Source #

invisP :: Quote m => m Type -> m Pat Source #

viewP :: Quote m => m Exp -> m Pat -> m Pat Source #

orP :: Quote m => NonEmpty (m Pat) -> m Pat Source #

fieldPat :: Quote m => Name -> m Pat -> m FieldPat Source #

# Stmt

bindS :: Quote m => m Pat -> m Exp -> m Stmt Source #

letS :: Quote m => [m Dec] -> m Stmt Source #

noBindS :: Quote m => m Exp -> m Stmt Source #

parS :: Quote m => [[m Stmt]] -> m Stmt Source #

recS :: Quote m => [m Stmt] -> m Stmt Source #

# Range

fromR :: Quote m => m Exp -> m Range Source #

fromThenR :: Quote m => m Exp -> m Exp -> m Range Source #

fromToR :: Quote m => m Exp -> m Exp -> m Range Source #

fromThenToR :: Quote m => m Exp -> m Exp -> m Exp -> m Range Source #

# Body

normalB :: Quote m => m Exp -> m Body Source #

guardedB :: Quote m => [m (Guard, Exp)] -> m Body Source #

# Guard

normalG :: Quote m => m Exp -> m Guard Source #

normalGE :: Quote m => m Exp -> m Exp -> m (Guard, Exp) Source #

patG :: Quote m => [m Stmt] -> m Guard Source #

patGE :: Quote m => [m Stmt] -> m Exp -> m (Guard, Exp) Source #

# Match and Clause

match :: Quote m => m Pat -> m Body -> [m Dec] -> m Match Source #

Use with `caseE`

clause :: Quote m => [m Pat] -> m Body -> [m Dec] -> m Clause Source #

Use with `funD`

# Exp

dyn :: Quote m => String -> m Exp Source #

Dynamically binding a variable (unhygienic)

varE :: Quote m => Name -> m Exp Source #

conE :: Quote m => Name -> m Exp Source #

litE :: Quote m => Lit -> m Exp Source #

appE :: Quote m => m Exp -> m Exp -> m Exp Source #

appTypeE :: Quote m => m Exp -> m Type -> m Exp Source #

parensE :: Quote m => m Exp -> m Exp Source #

uInfixE :: Quote m => m Exp -> m Exp -> m Exp -> m Exp Source #

infixE :: Quote m => Maybe (m Exp) -> m Exp -> Maybe (m Exp) -> m Exp Source #

infixApp :: Quote m => m Exp -> m Exp -> m Exp -> m Exp Source #

sectionL :: Quote m => m Exp -> m Exp -> m Exp Source #

sectionR :: Quote m => m Exp -> m Exp -> m Exp Source #

lamE :: Quote m => [m Pat] -> m Exp -> m Exp Source #

lam1E :: Quote m => m Pat -> m Exp -> m Exp Source #

Single-arg lambda

lamCaseE :: Quote m => [m Match] -> m Exp Source #

Lambda-case (`case`)

lamCasesE :: Quote m => [m Clause] -> m Exp Source #

Lambda-cases (`cases`)

tupE :: Quote m => [Maybe (m Exp)] -> m Exp Source #

unboxedTupE :: Quote m => [Maybe (m Exp)] -> m Exp Source #

unboxedSumE :: Quote m => m Exp -> SumAlt -> SumArity -> m Exp Source #

condE :: Quote m => m Exp -> m Exp -> m Exp -> m Exp Source #

multiIfE :: Quote m => [m (Guard, Exp)] -> m Exp Source #

letE :: Quote m => [m Dec] -> m Exp -> m Exp Source #

caseE :: Quote m => m Exp -> [m Match] -> m Exp Source #

doE :: Quote m => Maybe ModName -> [m Stmt] -> m Exp Source #

mdoE :: Quote m => Maybe ModName -> [m Stmt] -> m Exp Source #

compE :: Quote m => [m Stmt] -> m Exp Source #

arithSeqE :: Quote m => m Range -> m Exp Source #

listE :: Quote m => [m Exp] -> m Exp Source #

sigE :: Quote m => m Exp -> m Type -> m Exp Source #

recConE :: Quote m => Name -> [m (Name, Exp)] -> m Exp Source #

recUpdE :: Quote m => m Exp -> [m (Name, Exp)] -> m Exp Source #

stringE :: Quote m => String -> m Exp Source #

fieldExp :: Quote m => Name -> m Exp -> m (Name, Exp) Source #

staticE :: Quote m => m Exp -> m Exp Source #

    staticE x = [| static x |]

unboundVarE :: Quote m => Name -> m Exp Source #

labelE :: Quote m => String -> m Exp Source #

implicitParamVarE :: Quote m => String -> m Exp Source #

getFieldE :: Quote m => m Exp -> String -> m Exp Source #

projectionE :: Quote m => NonEmpty String -> m Exp Source #

typedSpliceE :: Quote m => m Exp -> m Exp Source #

typedBracketE :: Quote m => m Exp -> m Exp Source #

## `arithSeqE` Shortcuts

fromE :: Quote m => m Exp -> m Exp Source #

fromThenE :: Quote m => m Exp -> m Exp -> m Exp Source #

fromToE :: Quote m => m Exp -> m Exp -> m Exp Source #

fromThenToE :: Quote m => m Exp -> m Exp -> m Exp -> m Exp Source #

typeE :: Quote m => m Type -> m Exp Source #

forallE :: Quote m => [m (TyVarBndr Specificity)] -> m Exp -> m Exp Source #

forallVisE :: Quote m => [m (TyVarBndr ())] -> m Exp -> m Exp Source #

constrainedE :: Quote m => [m Exp] -> m Exp -> m Exp Source #

# Dec

valD :: Quote m => m Pat -> m Body -> [m Dec] -> m Dec Source #

funD :: Quote m => Name -> [m Clause] -> m Dec Source #

tySynD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> m Type -> m Dec Source #

dataD :: Quote m => m Cxt -> Name -> [m (TyVarBndr BndrVis)] -> Maybe (m Kind) -> [m Con] -> [m DerivClause] -> m Dec Source #

newtypeD :: Quote m => m Cxt -> Name -> [m (TyVarBndr BndrVis)] -> Maybe (m Kind) -> m Con -> [m DerivClause] -> m Dec Source #

typeDataD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> Maybe (m Kind) -> [m Con] -> m Dec Source #

classD :: Quote m => m Cxt -> Name -> [m (TyVarBndr BndrVis)] -> [FunDep] -> [m Dec] -> m Dec Source #

instanceD :: Quote m => m Cxt -> m Type -> [m Dec] -> m Dec Source #

instanceWithOverlapD :: Quote m => Maybe Overlap -> m Cxt -> m Type -> [m Dec] -> m Dec Source #

sigD :: Quote m => Name -> m Type -> m Dec Source #

kiSigD :: Quote m => Name -> m Kind -> m Dec Source #

forImpD :: Quote m => Callconv -> Safety -> String -> Name -> m Type -> m Dec Source #

infixLD :: Quote m => Int -> Name -> m Dec Source #

infixRD :: Quote m => Int -> Name -> m Dec Source #

infixND :: Quote m => Int -> Name -> m Dec Source #

infixLWithSpecD :: Quote m => Int -> NamespaceSpecifier -> Name -> m Dec Source #

infixRWithSpecD :: Quote m => Int -> NamespaceSpecifier -> Name -> m Dec Source #

infixNWithSpecD :: Quote m => Int -> NamespaceSpecifier -> Name -> m Dec Source #

defaultD :: Quote m => [m Type] -> m Dec Source #

pragInlD :: Quote m => Name -> Inline -> RuleMatch -> Phases -> m Dec Source #

pragOpaqueD :: Quote m => Name -> m Dec Source #

pragSpecED :: Quote m => Maybe [m (TyVarBndr ())] -> [m RuleBndr] -> m Exp -> Phases -> m Dec Source #

pragSpecInlED :: Quote m => Maybe [m (TyVarBndr ())] -> [m RuleBndr] -> m Exp -> Inline -> Phases -> m Dec Source #

pragSpecInstD :: Quote m => m Type -> m Dec Source #

pragRuleD :: Quote m => String -> Maybe [m (TyVarBndr ())] -> [m RuleBndr] -> m Exp -> m Exp -> Phases -> m Dec Source #

pragAnnD :: Quote m => AnnTarget -> m Exp -> m Dec Source #

pragLineD :: Quote m => Int -> String -> m Dec Source #

pragCompleteD :: Quote m => [Name] -> Maybe Name -> m Dec Source #

pragSCCFunD :: Quote m => Name -> m Dec Source #

pragSCCFunNamedD :: Quote m => Name -> String -> m Dec Source #

dataInstD :: Quote m => m Cxt -> Maybe [m (TyVarBndr ())] -> m Type -> Maybe (m Kind) -> [m Con] -> [m DerivClause] -> m Dec Source #

newtypeInstD :: Quote m => m Cxt -> Maybe [m (TyVarBndr ())] -> m Type -> Maybe (m Kind) -> m Con -> [m DerivClause] -> m Dec Source #

tySynInstD :: Quote m => m TySynEqn -> m Dec Source #

dataFamilyD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> Maybe (m Kind) -> m Dec Source #

openTypeFamilyD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> m FamilyResultSig -> Maybe InjectivityAnn -> m Dec Source #

closedTypeFamilyD :: Quote m => Name -> [m (TyVarBndr BndrVis)] -> m FamilyResultSig -> Maybe InjectivityAnn -> [m TySynEqn] -> m Dec Source #

roleAnnotD :: Quote m => Name -> [Role] -> m Dec Source #

standaloneDerivD :: Quote m => m Cxt -> m Type -> m Dec Source #

standaloneDerivWithStrategyD :: Quote m => Maybe (m DerivStrategy) -> m Cxt -> m Type -> m Dec Source #

defaultSigD :: Quote m => Name -> m Type -> m Dec Source #

patSynD :: Quote m => Name -> m PatSynArgs -> m PatSynDir -> m Pat -> m Dec Source #

Pattern synonym declaration

patSynSigD :: Quote m => Name -> m Type -> m Dec Source #

Pattern synonym type signature

implicitParamBindD :: Quote m => String -> m Exp -> m Dec Source #

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

tySynEqn :: Quote m => Maybe [m (TyVarBndr ())] -> m Type -> m Type -> m TySynEqn Source #

cxt :: Quote m => [m Pred] -> m Cxt Source #

derivClause :: Quote m => Maybe (m DerivStrategy) -> [m Pred] -> m DerivClause Source #

stockStrategy :: Quote m => m DerivStrategy Source #

anyclassStrategy :: Quote m => m DerivStrategy Source #

newtypeStrategy :: Quote m => m DerivStrategy Source #

viaStrategy :: Quote m => m Type -> m DerivStrategy Source #

normalC :: Quote m => Name -> [m BangType] -> m Con Source #

recC :: Quote m => Name -> [m VarBangType] -> m Con Source #

infixC :: Quote m => m (Bang, Type) -> Name -> m (Bang, Type) -> m Con Source #

forallC :: Quote m => [m (TyVarBndr Specificity)] -> m Cxt -> m Con -> m Con Source #

gadtC :: Quote m => [Name] -> [m StrictType] -> m Type -> m Con Source #

recGadtC :: Quote m => [Name] -> [m VarStrictType] -> m Type -> m Con Source #

# Type

forallT :: Quote m => [m (TyVarBndr Specificity)] -> m Cxt -> m Type -> m Type Source #

forallVisT :: Quote m => [m (TyVarBndr ())] -> m Type -> m Type Source #

varT :: Quote m => Name -> m Type Source #

conT :: Quote m => Name -> m Type Source #

infixT :: Quote m => m Type -> Name -> m Type -> m Type Source #

uInfixT :: Quote m => m Type -> Name -> m Type -> m Type Source #

promotedInfixT :: Quote m => m Type -> Name -> m Type -> m Type Source #

promotedUInfixT :: Quote m => m Type -> Name -> m Type -> m Type Source #

parensT :: Quote m => m Type -> m Type Source #

appT :: Quote m => m Type -> m Type -> m Type Source #

appKindT :: Quote m => m Type -> m Kind -> m Type Source #

arrowT :: Quote m => m Type Source #

mulArrowT :: Quote m => m Type Source #

listT :: Quote m => m Type Source #

litT :: Quote m => m TyLit -> m Type Source #

tupleT :: Quote m => Int -> m Type Source #

unboxedTupleT :: Quote m => Int -> m Type Source #

unboxedSumT :: Quote m => SumArity -> m Type Source #

sigT :: Quote m => m Type -> m Kind -> m Type Source #

equalityT :: Quote m => m Type Source #

wildCardT :: Quote m => m Type Source #

implicitParamT :: Quote m => String -> m Type -> m Type Source #

promotedT :: Quote m => Name -> m Type Source #

promotedTupleT :: Quote m => Int -> m Type Source #

promotedNilT :: Quote m => m Type Source #

promotedConsT :: Quote m => m Type Source #

noSourceUnpackedness :: Quote m => m SourceUnpackedness Source #

sourceNoUnpack :: Quote m => m SourceUnpackedness Source #

sourceUnpack :: Quote m => m SourceUnpackedness Source #

noSourceStrictness :: Quote m => m SourceStrictness Source #

sourceLazy :: Quote m => m SourceStrictness Source #

sourceStrict :: Quote m => m SourceStrictness Source #

bang :: Quote m => m SourceUnpackedness -> m SourceStrictness -> m Bang Source #

bangType :: Quote m => m Bang -> m Type -> m BangType Source #

varBangType :: Quote m => Name -> m BangType -> m VarBangType Source #

# Type Literals

numTyLit :: Quote m => Integer -> m TyLit Source #

strTyLit :: Quote m => String -> m TyLit Source #

charTyLit :: Quote m => Char -> m TyLit Source #

# Kind

plainTV :: Quote m => Name -> m (TyVarBndr ()) Source #

plainInvisTV :: Quote m => Name -> Specificity -> m (TyVarBndr Specificity) Source #

plainBndrTV :: Quote m => Name -> BndrVis -> m (TyVarBndr BndrVis) Source #

kindedTV :: Quote m => Name -> m Kind -> m (TyVarBndr ()) Source #

kindedInvisTV :: Quote m => Name -> Specificity -> m Kind -> m (TyVarBndr Specificity) Source #

kindedBndrTV :: Quote m => Name -> BndrVis -> m Kind -> m (TyVarBndr BndrVis) Source #

specifiedSpec :: Specificity Source #

inferredSpec :: Specificity Source #

bndrReq :: BndrVis Source #

bndrInvis :: BndrVis 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 :: Quote m => m Kind Source #

constraintK :: Quote m => m Kind Source #

# Type family result

noSig :: Quote m => m FamilyResultSig Source #

kindSig :: Quote m => m Kind -> m FamilyResultSig Source #

tyVarSig :: Quote m => m (TyVarBndr ()) -> m FamilyResultSig Source #

# Injectivity annotation

injectivityAnn :: Name -> [Name] -> InjectivityAnn Source #

# Role

nominalR :: Role Source #

representationalR :: Role Source #

phantomR :: Role Source #

inferR :: Role Source #

# Callconv

cCall :: Callconv Source #

stdCall :: Callconv Source #

cApi :: Callconv Source #

prim :: Callconv Source #

javaScript :: Callconv Source #

# Safety

unsafe :: Safety Source #

safe :: Safety Source #

interruptible :: Safety Source #

# FunDep

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

# RuleBndr

ruleVar :: Quote m => Name -> m RuleBndr Source #

typedRuleVar :: Quote m => Name -> m Type -> m RuleBndr Source #

# AnnTarget

valueAnnotation :: Name -> AnnTarget Source #

typeAnnotation :: Name -> AnnTarget Source #

moduleAnnotation :: AnnTarget Source #

# Pattern Synonyms (sub constructs)

unidir :: Quote m => m PatSynDir Source #

implBidir :: Quote m => m PatSynDir Source #

explBidir :: Quote m => [m Clause] -> m PatSynDir Source #

prefixPatSyn :: Quote m => [Name] -> m PatSynArgs Source #

recordPatSyn :: Quote m => [Name] -> m PatSynArgs Source #

infixPatSyn :: Quote m => Name -> Name -> m PatSynArgs Source #

# Useful helper function

appsE :: Quote m => [m Exp] -> m Exp Source #

thisModule :: Q Module Source #

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

# Documentation combinators

withDecDoc :: String -> Q Dec -> Q Dec Source #

Attaches Haddock documentation to the declaration provided. Unlike `putDoc`, the names do not need to be in scope when calling this function so it can be used for quoted declarations and anything else currently being spliced. Not all declarations can have documentation attached to them. For those that can't, `withDecDoc` will return it unchanged without any side effects.

withDecsDoc :: String -> Q [Dec] -> Q [Dec] Source #

Variant of `withDecDoc` that applies the same documentation to multiple declarations. Useful for documenting quoted declarations.

funD_doc Source #

Arguments

:: Name |
-> [Q Clause] |
-> Maybe String | Documentation to attach to function
-> [Maybe String] | Documentation to attach to arguments
-> Q Dec |

Variant of `funD` that attaches Haddock documentation.

dataD_doc Source #

Arguments

:: Q Cxt |
-> Name |
-> [Q (TyVarBndr BndrVis)] |
-> Maybe (Q Kind) |
-> [(Q Con, Maybe String, [Maybe String])] | List of constructors, documentation for the constructor, and documentation for the arguments
-> [Q DerivClause] |
-> Maybe String | Documentation to attach to the data declaration
-> Q Dec |

Variant of `dataD` that attaches Haddock documentation.

newtypeD_doc Source #

Arguments

:: Q Cxt |
-> Name |
-> [Q (TyVarBndr BndrVis)] |
-> Maybe (Q Kind) |
-> (Q Con, Maybe String, [Maybe String]) | The constructor, documentation for the constructor, and documentation for the arguments
-> [Q DerivClause] |
-> Maybe String | Documentation to attach to the newtype declaration
-> Q Dec |

Variant of `newtypeD` that attaches Haddock documentation.

typeDataD_doc Source #

Arguments

:: Name |
-> [Q (TyVarBndr BndrVis)] |
-> Maybe (Q Kind) |
-> [(Q Con, Maybe String, [Maybe String])] | List of constructors, documentation for the constructor, and documentation for the arguments
-> Maybe String | Documentation to attach to the data declaration
-> Q Dec |

Variant of `typeDataD` that attaches Haddock documentation.

dataInstD_doc Source #

Arguments

:: Q Cxt |
-> Maybe [Q (TyVarBndr ())] |
-> Q Type |
-> Maybe (Q Kind) |
-> [(Q Con, Maybe String, [Maybe String])] | List of constructors, documentation for the constructor, and documentation for the arguments
-> [Q DerivClause] |
-> Maybe String | Documentation to attach to the instance declaration
-> Q Dec |

Variant of `dataInstD` that attaches Haddock documentation.

newtypeInstD_doc Source #

Arguments

:: Q Cxt |
-> Maybe [Q (TyVarBndr ())] |
-> Q Type |
-> Maybe (Q Kind) |
-> (Q Con, Maybe String, [Maybe String]) | The constructor, documentation for the constructor, and documentation for the arguments
-> [Q DerivClause] |
-> Maybe String | Documentation to attach to the instance declaration
-> Q Dec |

Variant of `newtypeInstD` that attaches Haddock documentation.

patSynD_doc Source #

Arguments

:: Name |
-> Q PatSynArgs |
-> Q PatSynDir |
-> Q Pat |
-> Maybe String | Documentation to attach to the pattern synonym
-> [Maybe String] | Documentation to attach to the pattern arguments
-> Q Dec |

Variant of `patSynD` that attaches Haddock documentation.

docCons :: (Q Con, Maybe String, [Maybe String]) -> Q () Source #

Document a data/newtype constructor with its arguments.