1{- | The public face of Template Haskell 2 3For other documentation, refer to: 4<http://www.haskell.org/haskellwiki/Template_Haskell> 5 6-} 7{-# LANGUAGE Safe #-} 8module Language.Haskell.TH( 9 -- * The monad and its operations 10 Q, 11 runQ, 12 -- ** Administration: errors, locations and IO 13 reportError, -- :: String -> Q () 14 reportWarning, -- :: String -> Q () 15 report, -- :: Bool -> String -> Q () 16 recover, -- :: Q a -> Q a -> Q a 17 location, -- :: Q Loc 18 Loc(..), 19 runIO, -- :: IO a -> Q a 20 -- ** Querying the compiler 21 -- *** Reify 22 reify, -- :: Name -> Q Info 23 reifyModule, 24 Info(..), ModuleInfo(..), 25 InstanceDec, 26 ParentName, 27 SumAlt, SumArity, 28 Arity, 29 Unlifted, 30 -- *** Language extension lookup 31 Extension(..), 32 extsEnabled, isExtEnabled, 33 -- *** Name lookup 34 lookupTypeName, -- :: String -> Q (Maybe Name) 35 lookupValueName, -- :: String -> Q (Maybe Name) 36 -- *** Fixity lookup 37 reifyFixity, 38 -- *** Type lookup 39 reifyType, 40 -- *** Instance lookup 41 reifyInstances, 42 isInstance, 43 -- *** Roles lookup 44 reifyRoles, 45 -- *** Annotation lookup 46 reifyAnnotations, AnnLookup(..), 47 -- *** Constructor strictness lookup 48 reifyConStrictness, 49 50 -- * Typed expressions 51 TExp, unType, 52 53 -- * Names 54 Name, NameSpace, -- Abstract 55 -- ** Constructing names 56 mkName, -- :: String -> Name 57 newName, -- :: String -> Q Name 58 -- ** Deconstructing names 59 nameBase, -- :: Name -> String 60 nameModule, -- :: Name -> Maybe String 61 namePackage, -- :: Name -> Maybe String 62 nameSpace, -- :: Name -> Maybe NameSpace 63 -- ** Built-in names 64 tupleTypeName, tupleDataName, -- Int -> Name 65 unboxedTupleTypeName, unboxedTupleDataName, -- :: Int -> Name 66 unboxedSumTypeName, -- :: SumArity -> Name 67 unboxedSumDataName, -- :: SumAlt -> SumArity -> Name 68 69 -- * The algebraic data types 70 -- | The lowercase versions (/syntax operators/) of these constructors are 71 -- preferred to these constructors, since they compose better with 72 -- quotations (@[| |]@) and splices (@$( ... )@) 73 74 -- ** Declarations 75 Dec(..), Con(..), Clause(..), 76 SourceUnpackedness(..), SourceStrictness(..), DecidedStrictness(..), 77 Bang(..), Strict, Foreign(..), Callconv(..), Safety(..), Pragma(..), 78 Inline(..), RuleMatch(..), Phases(..), RuleBndr(..), AnnTarget(..), 79 FunDep(..), TySynEqn(..), TypeFamilyHead(..), 80 Fixity(..), FixityDirection(..), defaultFixity, maxPrecedence, 81 PatSynDir(..), PatSynArgs(..), 82 -- ** Expressions 83 Exp(..), Match(..), Body(..), Guard(..), Stmt(..), Range(..), Lit(..), 84 -- ** Patterns 85 Pat(..), FieldExp, FieldPat, 86 -- ** Types 87 Type(..), TyVarBndr(..), TyLit(..), Kind, Cxt, Pred, Syntax.Role(..), 88 FamilyResultSig(..), Syntax.InjectivityAnn(..), PatSynType, 89 90 -- * Library functions 91 module Language.Haskell.TH.Lib, 92 93 -- * Pretty-printer 94 Ppr(..), pprint, pprExp, pprLit, pprPat, pprParendType 95 96 ) where 97 98import Language.Haskell.TH.Syntax as Syntax 99import Language.Haskell.TH.Lib 100import Language.Haskell.TH.Ppr 101