Add INLINABLE pragmas in Template Haskell
[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,
73 -- **** Strictness
74 isStrict, notStrict, strictType, varStrictType,
75 -- **** Class Contexts
76 cxt, classP, equalP, normalC, recC, infixC,
77
78 -- *** Top Level Declarations
79 -- **** Data
80 valD, funD, tySynD, dataD, newtypeD,
81 -- **** Class
82 classD, instanceD, sigD,
83 -- **** Type Family / Data Family
84 familyNoKindD, familyKindD, dataInstD,
85 newtypeInstD, tySynInstD,
86 typeFam, dataFam,
87 -- **** Foreign Function Interface (FFI)
88 cCall, stdCall, unsafe, safe, forImpD,
89 -- **** Pragmas
90 -- | Just inline supported so far
91 inlineSpecNoPhase, inlineSpecPhase,
92 pragInlD, pragSpecD,
93
94 -- * Pretty-printer
95 Ppr(..), pprint, pprExp, pprLit, pprPat, pprParendType
96
97 ) where
98
99 import Language.Haskell.TH.Syntax
100 import Language.Haskell.TH.Lib
101 import Language.Haskell.TH.Ppr
102