Re-export forallC in Language.Haskell.TH (#7009)
[ghc.git] / libraries / template-haskell / Language / Haskell / TH.hs
1 {- | The public face of Template Haskell
2
3 For other documentation, refer to:
4 <http://www.haskell.org/haskellwiki/Template_Haskell>
5
6 -}
7 module Language.Haskell.TH(
8 -- * The monad and its operations
9 Q, runQ,
10 report, -- :: Bool -> String -> Q ()
11 recover, -- :: Q a -> Q a -> Q a
12 reify, -- :: Name -> Q Info
13 location, -- :: Q Location
14 runIO, -- :: IO a -> Q a
15 lookupTypeName, lookupValueName,
16 isInstance, reifyInstances,
17
18 -- * Names
19 Name, NameSpace, -- Abstract
20 mkName, -- :: String -> Name
21 newName, -- :: String -> Q Name
22 nameBase, -- :: Name -> String
23 nameModule, -- :: Name -> Maybe String
24 tupleTypeName, tupleDataName, -- Int -> Name
25
26 -- * The algebraic data types
27 -- | The lowercase versions (/syntax operators/) of these constructors are
28 -- preferred to these constructors, since they compose better with
29 -- quotations (@[| |]@) and splices (@$( ... )@)
30 Dec(..), Exp(..), Con(..), Type(..), TyVarBndr(..), TyLit(..), Kind, Cxt,
31 Pred(..), Match(..), Clause(..), Body(..), Guard(..), Stmt(..),
32 Range(..), Lit(..), Pat(..), FieldExp, FieldPat,
33 Strict(..), Foreign(..), Callconv(..), Safety(..), Pragma(..),
34 Inline(..), InlineSpec(..), FunDep(..), FamFlavour(..), Info(..), Loc(..),
35 Fixity(..), FixityDirection(..), defaultFixity, maxPrecedence,
36
37 -- * Library functions
38 -- ** Abbreviations
39 InfoQ, ExpQ, DecQ, DecsQ, ConQ, TypeQ, TyLitQ, CxtQ, PredQ, MatchQ, ClauseQ,
40 BodyQ, GuardQ, StmtQ, RangeQ, StrictTypeQ, VarStrictTypeQ, PatQ, FieldPatQ,
41 InlineSpecQ,
42
43 -- ** Constructors lifted to 'Q'
44 -- *** Literals
45 intPrimL, wordPrimL, floatPrimL, doublePrimL, integerL, rationalL,
46 charL, stringL, stringPrimL,
47 -- *** Patterns
48 litP, varP, tupP, conP, uInfixP, parensP, infixP,
49 tildeP, bangP, asP, wildP, recP,
50 listP, sigP, viewP,
51 fieldPat,
52
53 -- *** Pattern Guards
54 normalB, guardedB, normalG, normalGE, patG, patGE, match, clause,
55
56 -- *** Expressions
57 dyn, global, varE, conE, litE, appE, uInfixE, parensE,
58 infixE, infixApp, sectionL, sectionR,
59 lamE, lam1E, tupE, condE, letE, caseE, appsE,
60 listE, sigE, recConE, recUpdE, stringE, fieldExp,
61 -- **** Ranges
62 fromE, fromThenE, fromToE, fromThenToE,
63
64 -- ***** Ranges with more indirection
65 arithSeqE,
66 fromR, fromThenR, fromToR, fromThenToR,
67 -- **** Statements
68 doE, compE,
69 bindS, letS, noBindS, parS,
70
71 -- *** Types
72 forallT, varT, conT, appT, arrowT, listT, tupleT, sigT, litT,
73 promotedT, promotedTupleT, promotedNilT, promotedConsT,
74 -- **** Type literals
75 numTyLit, strTyLit,
76 -- **** Strictness
77 isStrict, notStrict, strictType, varStrictType,
78 -- **** Class Contexts
79 cxt, classP, equalP, normalC, recC, infixC, forallC,
80
81 -- *** Kinds
82 varK, conK, tupleK, arrowK, listK, appK, starK, constraintK,
83
84 -- *** Top Level Declarations
85 -- **** Data
86 valD, funD, tySynD, dataD, newtypeD,
87 -- **** Class
88 classD, instanceD, sigD,
89 -- **** Type Family / Data Family
90 familyNoKindD, familyKindD, dataInstD,
91 newtypeInstD, tySynInstD,
92 typeFam, dataFam,
93 -- **** Foreign Function Interface (FFI)
94 cCall, stdCall, unsafe, safe, forImpD,
95 -- **** Pragmas
96 -- | Just inline supported so far
97 inlineSpecNoPhase, inlineSpecPhase,
98 pragInlD, pragSpecD,
99
100 -- * Pretty-printer
101 Ppr(..), pprint, pprExp, pprLit, pprPat, pprParendType
102
103 ) where
104
105 import Language.Haskell.TH.Syntax
106 import Language.Haskell.TH.Lib
107 import Language.Haskell.TH.Ppr
108