-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Support library for Template Haskell -- -- This package provides modules containing facilities for manipulating -- Haskell source code using Template Haskell. -- -- See http://www.haskell.org/haskellwiki/Template_Haskell for -- more information. @package template-haskell @version 2.14.0.0 -- | Language extensions known to GHC module Language.Haskell.TH.LanguageExtensions -- | The language extensions known to GHC. -- -- Note that there is an orphan Binary instance for this type -- supplied by the GHC.LanguageExtensions module provided by -- ghc-boot. We can't provide here as this would require adding -- transitive dependencies to the template-haskell package, -- which must have a minimal dependency set. data Extension Cpp :: Extension OverlappingInstances :: Extension UndecidableInstances :: Extension IncoherentInstances :: Extension UndecidableSuperClasses :: Extension MonomorphismRestriction :: Extension MonoPatBinds :: Extension MonoLocalBinds :: Extension RelaxedPolyRec :: Extension ExtendedDefaultRules :: Extension ForeignFunctionInterface :: Extension UnliftedFFITypes :: Extension InterruptibleFFI :: Extension CApiFFI :: Extension GHCForeignImportPrim :: Extension JavaScriptFFI :: Extension ParallelArrays :: Extension Arrows :: Extension TemplateHaskell :: Extension TemplateHaskellQuotes :: Extension QuasiQuotes :: Extension ImplicitParams :: Extension ImplicitPrelude :: Extension ScopedTypeVariables :: Extension AllowAmbiguousTypes :: Extension UnboxedTuples :: Extension UnboxedSums :: Extension BangPatterns :: Extension TypeFamilies :: Extension TypeFamilyDependencies :: Extension TypeInType :: Extension OverloadedStrings :: Extension OverloadedLists :: Extension NumDecimals :: Extension DisambiguateRecordFields :: Extension RecordWildCards :: Extension RecordPuns :: Extension ViewPatterns :: Extension GADTs :: Extension GADTSyntax :: Extension NPlusKPatterns :: Extension DoAndIfThenElse :: Extension BlockArguments :: Extension RebindableSyntax :: Extension ConstraintKinds :: Extension PolyKinds :: Extension DataKinds :: Extension InstanceSigs :: Extension ApplicativeDo :: Extension StandaloneDeriving :: Extension DeriveDataTypeable :: Extension AutoDeriveTypeable :: Extension DeriveFunctor :: Extension DeriveTraversable :: Extension DeriveFoldable :: Extension DeriveGeneric :: Extension DefaultSignatures :: Extension DeriveAnyClass :: Extension DeriveLift :: Extension DerivingStrategies :: Extension DerivingVia :: Extension TypeSynonymInstances :: Extension FlexibleContexts :: Extension FlexibleInstances :: Extension ConstrainedClassMethods :: Extension MultiParamTypeClasses :: Extension NullaryTypeClasses :: Extension FunctionalDependencies :: Extension UnicodeSyntax :: Extension ExistentialQuantification :: Extension MagicHash :: Extension EmptyDataDecls :: Extension KindSignatures :: Extension RoleAnnotations :: Extension ParallelListComp :: Extension TransformListComp :: Extension MonadComprehensions :: Extension GeneralizedNewtypeDeriving :: Extension RecursiveDo :: Extension PostfixOperators :: Extension TupleSections :: Extension PatternGuards :: Extension LiberalTypeSynonyms :: Extension RankNTypes :: Extension ImpredicativeTypes :: Extension TypeOperators :: Extension ExplicitNamespaces :: Extension PackageImports :: Extension ExplicitForAll :: Extension AlternativeLayoutRule :: Extension AlternativeLayoutRuleTransitional :: Extension DatatypeContexts :: Extension NondecreasingIndentation :: Extension RelaxedLayout :: Extension TraditionalRecordSyntax :: Extension LambdaCase :: Extension MultiWayIf :: Extension BinaryLiterals :: Extension NegativeLiterals :: Extension HexFloatLiterals :: Extension DuplicateRecordFields :: Extension OverloadedLabels :: Extension EmptyCase :: Extension PatternSynonyms :: Extension PartialTypeSignatures :: Extension NamedWildCards :: Extension StaticPointers :: Extension TypeApplications :: Extension Strict :: Extension StrictData :: Extension MonadFailDesugaring :: Extension EmptyDataDeriving :: Extension NumericUnderscores :: Extension QuantifiedConstraints :: Extension StarIsType :: Extension -- | Abstract syntax definitions for Template Haskell. module Language.Haskell.TH.Syntax returnQ :: a -> Q a bindQ :: Q a -> (a -> Q b) -> Q b sequenceQ :: [Q a] -> Q [a] -- | Generate a fresh name, which cannot be captured. -- -- For example, this: -- --
--   f = $(do
--     nm1 <- newName "x"
--     let nm2 = mkName "x"
--     return (LamE [VarP nm1] (LamE [VarP nm2] (VarE nm1)))
--    )
--   
-- -- will produce the splice -- --
--   f = \x0 -> \x -> x0
--   
-- -- In particular, the occurrence VarE nm1 refers to the binding -- VarP nm1, and is not captured by the binding VarP -- nm2. -- -- Although names generated by newName cannot be -- captured, they can capture other names. For example, this: -- --
--   g = $(do
--     nm1 <- newName "x"
--     let nm2 = mkName "x"
--     return (LamE [VarP nm2] (LamE [VarP nm1] (VarE nm2)))
--    )
--   
-- -- will produce the splice -- --
--   g = \x -> \x0 -> x0
--   
-- -- since the occurrence VarE nm2 is captured by the innermost -- binding of x, namely VarP nm1. newName :: String -> Q Name -- | Generate a capturable name. Occurrences of such names will be resolved -- according to the Haskell scoping rules at the occurrence site. -- -- For example: -- --
--   f = [| pi + $(varE (mkName "pi")) |]
--   ...
--   g = let pi = 3 in $f
--   
-- -- In this case, g is desugared to -- --
--   g = Prelude.pi + 3
--   
-- -- Note that mkName may be used with qualified names: -- --
--   mkName "Prelude.pi"
--   
-- -- See also dyn for a useful combinator. The above example could -- be rewritten using dyn as -- --
--   f = [| pi + $(dyn "pi") |]
--   
mkName :: String -> Name mkNameG_v :: String -> String -> String -> Name mkNameG_d :: String -> String -> String -> Name mkNameG_tc :: String -> String -> String -> Name -- | Only used internally mkNameL :: String -> Uniq -> Name mkNameS :: String -> Name unTypeQ :: Q (TExp a) -> Q Exp unsafeTExpCoerce :: Q Exp -> Q (TExp a) liftString :: String -> Q Exp -- | A Lift instance can have any of its values turned into a -- Template Haskell expression. This is needed when a value used within a -- Template Haskell quotation is bound outside the Oxford brackets -- ([| ... |]) but not at the top level. As an example: -- --
--   add1 :: Int -> Q Exp
--   add1 x = [| x + 1 |]
--   
-- -- Template Haskell has no way of knowing what value x will take -- on at splice-time, so it requires the type of x to be an -- instance of Lift. -- -- A Lift instance must satisfy $(lift x) ≡ x for all -- x, where $(...) is a Template Haskell splice. -- -- Lift instances can be derived automatically by use of the -- -XDeriveLift GHC language extension: -- --
--   {-# LANGUAGE DeriveLift #-}
--   module Foo where
--   
--   import Language.Haskell.TH.Syntax
--   
--   data Bar a = Bar1 a (Bar a) | Bar2 String
--     deriving Lift
--   
class Lift t -- | Turn a value into a Template Haskell expression, suitable for use in a -- splice. lift :: Lift t => t -> Q Exp -- | Turn a value into a Template Haskell expression, suitable for use in a -- splice. lift :: (Lift t, Data t) => t -> Q Exp data Exp -- |
--   { x }
--   
VarE :: Name -> Exp -- |
--   data T1 = C1 t1 t2; p = {C1} e1 e2
--   
ConE :: Name -> Exp -- |
--   { 5 or 'c'}
--   
LitE :: Lit -> Exp -- |
--   { f x }
--   
AppE :: Exp -> Exp -> Exp -- |
--   { f @Int }
--   
AppTypeE :: Exp -> Type -> Exp -- |
--   {x + y} or {(x+)} or {(+ x)} or {(+)}
--   
InfixE :: Maybe Exp -> Exp -> Maybe Exp -> Exp -- |
--   {x + y}
--   
-- -- See Language.Haskell.TH.Syntax#infix UInfixE :: Exp -> Exp -> Exp -> Exp -- |
--   { (e) }
--   
-- -- See Language.Haskell.TH.Syntax#infix ParensE :: Exp -> Exp -- |
--   { \ p1 p2 -> e }
--   
LamE :: [Pat] -> Exp -> Exp -- |
--   { \case m1; m2 }
--   
LamCaseE :: [Match] -> Exp -- |
--   { (e1,e2) }
--   
TupE :: [Exp] -> Exp -- |
--   { (# e1,e2 #) }
--   
UnboxedTupE :: [Exp] -> Exp -- |
--   { (#|e|#) }
--   
UnboxedSumE :: Exp -> SumAlt -> SumArity -> Exp -- |
--   { if e1 then e2 else e3 }
--   
CondE :: Exp -> Exp -> Exp -> Exp -- |
--   { if | g1 -> e1 | g2 -> e2 }
--   
MultiIfE :: [(Guard, Exp)] -> Exp -- |
--   { let x=e1;   y=e2 in e3 }
--   
LetE :: [Dec] -> Exp -> Exp -- |
--   { case e of m1; m2 }
--   
CaseE :: Exp -> [Match] -> Exp -- |
--   { do { p <- e1; e2 }  }
--   
DoE :: [Stmt] -> Exp -- |
--   { [ (x,y) | x <- xs, y <- ys ] }
--   
-- -- The result expression of the comprehension is the last of the -- Stmts, and should be a NoBindS. -- -- E.g. translation: -- --
--   [ f x | x <- xs ]
--   
-- --
--   CompE [BindS (VarP x) (VarE xs), NoBindS (AppE (VarE f) (VarE x))]
--   
CompE :: [Stmt] -> Exp -- |
--   { [ 1 ,2 .. 10 ] }
--   
ArithSeqE :: Range -> Exp -- |
--   { [1,2,3] }
--   
ListE :: [Exp] -> Exp -- |
--   { e :: t }
--   
SigE :: Exp -> Type -> Exp -- |
--   { T { x = y, z = w } }
--   
RecConE :: Name -> [FieldExp] -> Exp -- |
--   { (f x) { z = w } }
--   
RecUpdE :: Exp -> [FieldExp] -> Exp -- |
--   { static e }
--   
StaticE :: Exp -> Exp -- | { _x } (hole) UnboundVarE :: Name -> Exp -- | { #x } ( Overloaded label ) LabelE :: String -> Exp data Match -- |
--   case e of { pat -> body where decs }
--   
Match :: Pat -> Body -> [Dec] -> Match data Clause -- |
--   f { p1 p2 = body where decs }
--   
Clause :: [Pat] -> Body -> [Dec] -> Clause newtype Q a Q :: (forall m. Quasi m => m a) -> Q a [unQ] :: Q a -> forall m. Quasi m => m a -- | Pattern in Haskell given in {} data Pat -- |
--   { 5 or 'c' }
--   
LitP :: Lit -> Pat -- |
--   { x }
--   
VarP :: Name -> Pat -- |
--   { (p1,p2) }
--   
TupP :: [Pat] -> Pat -- |
--   { (# p1,p2 #) }
--   
UnboxedTupP :: [Pat] -> Pat -- |
--   { (#|p|#) }
--   
UnboxedSumP :: Pat -> SumAlt -> SumArity -> Pat -- |
--   data T1 = C1 t1 t2; {C1 p1 p1} = e
--   
ConP :: Name -> [Pat] -> Pat -- |
--   foo ({x :+ y}) = e
--   
InfixP :: Pat -> Name -> Pat -> Pat -- |
--   foo ({x :+ y}) = e
--   
-- -- See Language.Haskell.TH.Syntax#infix UInfixP :: Pat -> Name -> Pat -> Pat -- |
--   {(p)}
--   
-- -- See Language.Haskell.TH.Syntax#infix ParensP :: Pat -> Pat -- |
--   { ~p }
--   
TildeP :: Pat -> Pat -- |
--   { !p }
--   
BangP :: Pat -> Pat -- |
--   { x @ p }
--   
AsP :: Name -> Pat -> Pat -- |
--   { _ }
--   
WildP :: Pat -- |
--   f (Pt { pointx = x }) = g x
--   
RecP :: Name -> [FieldPat] -> Pat -- |
--   { [1,2,3] }
--   
ListP :: [Pat] -> Pat -- |
--   { p :: t }
--   
SigP :: Pat -> Type -> Pat -- |
--   { e -> p }
--   
ViewP :: Exp -> Pat -> Pat data Type -- |
--   forall <vars>. <ctxt> => <type>
--   
ForallT :: [TyVarBndr] -> Cxt -> Type -> Type -- |
--   T a b
--   
AppT :: Type -> Type -> Type -- |
--   t :: k
--   
SigT :: Type -> Kind -> Type -- |
--   a
--   
VarT :: Name -> Type -- |
--   T
--   
ConT :: Name -> Type -- |
--   'T
--   
PromotedT :: Name -> Type -- |
--   T + T
--   
InfixT :: Type -> Name -> Type -> Type -- |
--   T + T
--   
-- -- See Language.Haskell.TH.Syntax#infix UInfixT :: Type -> Name -> Type -> Type -- |
--   (T)
--   
ParensT :: Type -> Type -- |
--   (,), (,,), etc.
--   
TupleT :: Int -> Type -- |
--   (#,#), (#,,#), etc.
--   
UnboxedTupleT :: Int -> Type -- |
--   (#|#), (#||#), etc.
--   
UnboxedSumT :: SumArity -> Type -- |
--   ->
--   
ArrowT :: Type -- |
--   ~
--   
EqualityT :: Type -- |
--   []
--   
ListT :: Type -- |
--   '(), '(,), '(,,), etc.
--   
PromotedTupleT :: Int -> Type -- |
--   '[]
--   
PromotedNilT :: Type -- |
--   (':)
--   
PromotedConsT :: Type -- |
--   *
--   
StarT :: Type -- |
--   Constraint
--   
ConstraintT :: Type -- |
--   0,1,2, etc.
--   
LitT :: TyLit -> Type -- |
--   _
--   
WildCardT :: Type data Dec -- |
--   { f p1 p2 = b where decs }
--   
FunD :: Name -> [Clause] -> Dec -- |
--   { p = b where decs }
--   
ValD :: Pat -> Body -> [Dec] -> Dec -- |
--   { data Cxt x => T x = A x | B (T x)
--          deriving (Z,W)
--          deriving stock Eq }
--   
DataD :: Cxt -> Name -> [TyVarBndr] -> Maybe Kind -> [Con] -> [DerivClause] -> Dec -- |
--   { newtype Cxt x => T x = A (B x)
--          deriving (Z,W Q)
--          deriving stock Eq }
--   
NewtypeD :: Cxt -> Name -> [TyVarBndr] -> Maybe Kind -> Con -> [DerivClause] -> Dec -- |
--   { type T x = (x,x) }
--   
TySynD :: Name -> [TyVarBndr] -> Type -> Dec -- |
--   { class Eq a => Ord a where ds }
--   
ClassD :: Cxt -> Name -> [TyVarBndr] -> [FunDep] -> [Dec] -> Dec -- |
--   { instance {-# OVERLAPS #-}
--           Show w => Show [w] where ds }
--   
InstanceD :: Maybe Overlap -> Cxt -> Type -> [Dec] -> Dec -- |
--   { length :: [a] -> Int }
--   
SigD :: Name -> Type -> Dec -- |
--   { foreign import ... }
--   { foreign export ... }
--   
ForeignD :: Foreign -> Dec -- |
--   { infix 3 foo }
--   
InfixD :: Fixity -> Name -> Dec -- |
--   { {-# INLINE [1] foo #-} }
--   
PragmaD :: Pragma -> Dec -- |
--   { data family T a b c :: * }
--   
DataFamilyD :: Name -> [TyVarBndr] -> Maybe Kind -> Dec -- |
--   { data instance Cxt x => T [x]
--          = A x | B (T x)
--          deriving (Z,W)
--          deriving stock Eq }
--   
DataInstD :: Cxt -> Name -> [Type] -> Maybe Kind -> [Con] -> [DerivClause] -> Dec -- |
--   { newtype instance Cxt x => T [x]
--           = A (B x)
--           deriving (Z,W)
--           deriving stock Eq }
--   
NewtypeInstD :: Cxt -> Name -> [Type] -> Maybe Kind -> Con -> [DerivClause] -> Dec -- |
--   { type instance ... }
--   
TySynInstD :: Name -> TySynEqn -> Dec -- |
--   { type family T a b c = (r :: *) | r -> a b }
--   
OpenTypeFamilyD :: TypeFamilyHead -> Dec -- |
--   { type family F a b = (r :: *) | r -> a where ... }
--   
ClosedTypeFamilyD :: TypeFamilyHead -> [TySynEqn] -> Dec -- |
--   { type role T nominal representational }
--   
RoleAnnotD :: Name -> [Role] -> Dec -- |
--   { deriving stock instance Ord a => Ord (Foo a) }
--   
StandaloneDerivD :: Maybe DerivStrategy -> Cxt -> Type -> Dec -- |
--   { default size :: Data a => a -> Int }
--   
DefaultSigD :: Name -> Type -> Dec -- | { pattern P v1 v2 .. vn <- p } unidirectional or { -- pattern P v1 v2 .. vn = p } implicit bidirectional or { -- pattern P v1 v2 .. vn <- p where P v1 v2 .. vn = e } explicit -- bidirectional -- -- also, besides prefix pattern synonyms, both infix and record pattern -- synonyms are supported. See PatSynArgs for details PatSynD :: Name -> PatSynArgs -> PatSynDir -> Pat -> Dec -- | A pattern synonym's type signature. PatSynSigD :: Name -> PatSynType -> Dec type FieldExp = (Name, Exp) type FieldPat = (Name, Pat) -- | An abstract type representing names in the syntax tree. -- -- Names can be constructed in several ways, which come with -- different name-capture guarantees (see -- Language.Haskell.TH.Syntax#namecapture for an explanation of -- name capture): -- -- -- -- Names constructed using newName and mkName may be -- used in bindings (such as let x = ... or x -> -- ...), but names constructed using lookupValueName, -- lookupTypeName, 'f, ''T may not. data Name Name :: OccName -> NameFlavour -> Name data FunDep FunDep :: [Name] -> [Name] -> FunDep -- | Since the advent of ConstraintKinds, constraints are really -- just types. Equality constraints use the EqualityT constructor. -- Constraints may also be tuples of other constraints. type Pred = Type newtype TExp a TExp :: Exp -> TExp a [unType] :: TExp a -> Exp -- | Injectivity annotation data InjectivityAnn InjectivityAnn :: Name -> [Name] -> InjectivityAnn -- | Varieties of allowed instance overlap. data Overlap -- | May be overlapped by more specific instances Overlappable :: Overlap -- | May overlap a more general instance Overlapping :: Overlap -- | Both Overlapping and Overlappable Overlaps :: Overlap -- | Both Overlappable and Overlappable, and pick an -- arbitrary one if multiple choices are available. Incoherent :: Overlap -- | To avoid duplication between kinds and types, they are defined to be -- the same. Naturally, you would never have a type be StarT and -- you would never have a kind be SigT, but many of the other -- constructors are shared. Note that the kind Bool is denoted -- with ConT, not PromotedT. Similarly, tuple kinds are -- made with TupleT, not PromotedTupleT. type Kind = Type -- | Annotation target for reifyAnnotations data AnnLookup AnnLookupModule :: Module -> AnnLookup AnnLookupName :: Name -> AnnLookup -- | Role annotations data Role -- |
--   nominal
--   
NominalR :: Role -- |
--   representational
--   
RepresentationalR :: Role -- |
--   phantom
--   
PhantomR :: Role -- |
--   _
--   
InferR :: Role data TyLit -- |
--   2
--   
NumTyLit :: Integer -> TyLit -- |
--   "Hello"
--   
StrTyLit :: String -> TyLit -- | Type family result signature data FamilyResultSig -- | no signature NoSig :: FamilyResultSig -- |
--   k
--   
KindSig :: Kind -> FamilyResultSig -- |
--   = r, = (r :: k)
--   
TyVarSig :: TyVarBndr -> FamilyResultSig data TyVarBndr -- |
--   a
--   
PlainTV :: Name -> TyVarBndr -- |
--   (a :: k)
--   
KindedTV :: Name -> Kind -> TyVarBndr -- | A pattern synonym's argument type. data PatSynArgs -- |
--   pattern P {x y z} = p
--   
PrefixPatSyn :: [Name] -> PatSynArgs -- |
--   pattern {x P y} = p
--   
InfixPatSyn :: Name -> Name -> PatSynArgs -- |
--   pattern P { {x,y,z} } = p
--   
RecordPatSyn :: [Name] -> PatSynArgs -- | A pattern synonym's directionality. data PatSynDir -- |
--   pattern P x {<-} p
--   
Unidir :: PatSynDir -- |
--   pattern P x {=} p
--   
ImplBidir :: PatSynDir -- |
--   pattern P x {<-} p where P x = e
--   
ExplBidir :: [Clause] -> PatSynDir -- | As of template-haskell-2.11.0.0, VarStrictType has -- been replaced by VarBangType. type VarStrictType = VarBangType -- | As of template-haskell-2.11.0.0, StrictType has been -- replaced by BangType. type StrictType = BangType -- | As of template-haskell-2.11.0.0, Strict has been -- replaced by Bang. type Strict = Bang type VarBangType = (Name, Bang, Type) type BangType = (Bang, Type) data Bang -- |
--   C { {-# UNPACK #-} !}a
--   
Bang :: SourceUnpackedness -> SourceStrictness -> Bang -- | A single data constructor. -- -- The constructors for Con can roughly be divided up into two -- categories: those for constructors with "vanilla" syntax -- (NormalC, RecC, and InfixC), and those for -- constructors with GADT syntax (GadtC and RecGadtC). The -- ForallC constructor, which quantifies additional type variables -- and class contexts, can surround either variety of constructor. -- However, the type variables that it quantifies are different depending -- on what constructor syntax is used: -- -- -- --
--   data Foo a = forall b. MkFoo a b
--   
--   
-- -- In MkFoo, ForallC will quantify b, but not -- a. -- -- -- --
--   data Bar a b where
--     MkBar :: (a ~ b) => c -> MkBar a b
--   
--   
-- -- In MkBar, ForallC will quantify a, -- b, and c. data Con -- |
--   C Int a
--   
NormalC :: Name -> [BangType] -> Con -- |
--   C { v :: Int, w :: a }
--   
RecC :: Name -> [VarBangType] -> Con -- |
--   Int :+ a
--   
InfixC :: BangType -> Name -> BangType -> Con -- |
--   forall a. Eq a => C [a]
--   
ForallC :: [TyVarBndr] -> Cxt -> Con -> Con -- |
--   C :: a -> b -> T b Int
--   
GadtC :: [Name] -> [BangType] -> Type -> Con -- |
--   C :: { v :: Int } -> T b Int
--   
RecGadtC :: [Name] -> [VarBangType] -> Type -> Con -- | Unlike SourceStrictness and SourceUnpackedness, -- DecidedStrictness refers to the strictness that the compiler -- chooses for a data constructor field, which may be different from what -- is written in source code. See reifyConStrictness for more -- information. data DecidedStrictness DecidedLazy :: DecidedStrictness DecidedStrict :: DecidedStrictness DecidedUnpack :: DecidedStrictness data SourceStrictness -- |
--   C a
--   
NoSourceStrictness :: SourceStrictness -- |
--   C {~}a
--   
SourceLazy :: SourceStrictness -- |
--   C {!}a
--   
SourceStrict :: SourceStrictness data SourceUnpackedness -- |
--   C a
--   
NoSourceUnpackedness :: SourceUnpackedness -- |
--   C { {-# NOUNPACK #-} } a
--   
SourceNoUnpack :: SourceUnpackedness -- |
--   C { {-# UNPACK #-} } a
--   
SourceUnpack :: SourceUnpackedness type Cxt = [Pred] " @(Eq a, Ord b)@" data AnnTarget ModuleAnnotation :: AnnTarget TypeAnnotation :: Name -> AnnTarget ValueAnnotation :: Name -> AnnTarget data RuleBndr RuleVar :: Name -> RuleBndr TypedRuleVar :: Name -> Type -> RuleBndr data Phases AllPhases :: Phases FromPhase :: Int -> Phases BeforePhase :: Int -> Phases data RuleMatch ConLike :: RuleMatch FunLike :: RuleMatch data Inline NoInline :: Inline Inline :: Inline Inlinable :: Inline data Pragma InlineP :: Name -> Inline -> RuleMatch -> Phases -> Pragma SpecialiseP :: Name -> Type -> Maybe Inline -> Phases -> Pragma SpecialiseInstP :: Type -> Pragma RuleP :: String -> [RuleBndr] -> Exp -> Exp -> Phases -> Pragma AnnP :: AnnTarget -> Exp -> Pragma LineP :: Int -> String -> Pragma -- |
--   { {-# COMPLETE C_1, ..., C_i [ :: T ] #-} }
--   
CompleteP :: [Name] -> Maybe Name -> Pragma data Safety Unsafe :: Safety Safe :: Safety Interruptible :: Safety data Callconv CCall :: Callconv StdCall :: Callconv CApi :: Callconv Prim :: Callconv JavaScript :: Callconv data Foreign ImportF :: Callconv -> Safety -> String -> Name -> Type -> Foreign ExportF :: Callconv -> String -> Name -> Type -> Foreign -- | One equation of a type family instance or closed type family. The -- arguments are the left-hand-side type patterns and the right-hand-side -- result. data TySynEqn TySynEqn :: [Type] -> Type -> TySynEqn -- | Common elements of OpenTypeFamilyD and -- ClosedTypeFamilyD. By analogy with "head" for type classes and -- type class instances as defined in Type classes: an exploration of -- the design space, the TypeFamilyHead is defined to be the -- elements of the declaration between type family and -- where. data TypeFamilyHead TypeFamilyHead :: Name -> [TyVarBndr] -> FamilyResultSig -> Maybe InjectivityAnn -> TypeFamilyHead -- | A Pattern synonym's type. Note that a pattern synonym's *fully* -- specified type has a peculiar shape coming with two forall quantifiers -- and two constraint contexts. For example, consider the pattern synonym -- -- pattern P x1 x2 ... xn = some-pattern -- -- P's complete type is of the following form -- -- forall universals. required constraints => forall existentials. -- provided constraints => t1 -> t2 -> ... -> tn -> t -- -- consisting of four parts: -- -- 1) the (possibly empty lists of) universally quantified type variables -- and required constraints on them. 2) the (possibly empty lists of) -- existentially quantified type variables and the provided constraints -- on them. 3) the types t1, t2, .., tn of x1, x2, .., xn, respectively -- 4) the type t of some-pattern, mentioning only universals. -- -- Pattern synonym types interact with TH when (a) reifying a pattern -- synonym, (b) pretty printing, or (c) specifying a pattern synonym's -- type signature explicitly: -- -- (a) Reification always returns a pattern synonym's *fully* specified -- type in abstract syntax. -- -- (b) Pretty printing via pprPatSynType abbreviates a pattern -- synonym's type unambiguously in concrete syntax: The rule of thumb is -- to print initial empty universals and the required context as `() -- =>`, if existentials and a provided context follow. If only -- universals and their required context, but no existentials are -- specified, only the universals and their required context are printed. -- If both or none are specified, so both (or none) are printed. -- -- (c) When specifying a pattern synonym's type explicitly with -- PatSynSigD either one of the universals, the existentials, or -- their contexts may be left empty. -- -- See the GHC user's guide for more information on pattern synonyms and -- their types: -- https://downloads.haskell.org/~ghc/latest/docs/html/ -- users_guide/syntax-extns.html#pattern-synonyms. type PatSynType = Type -- | What the user explicitly requests when deriving an instance. data DerivStrategy -- | A "standard" derived instance StockStrategy :: DerivStrategy -- |
--   -XDeriveAnyClass
--   
AnyclassStrategy :: DerivStrategy -- |
--   -XGeneralizedNewtypeDeriving
--   
NewtypeStrategy :: DerivStrategy -- |
--   -XDerivingVia
--   
ViaStrategy :: Type -> DerivStrategy -- | A single deriving clause at the end of a datatype. data DerivClause -- |
--   { deriving stock (Eq, Ord) }
--   
DerivClause :: Maybe DerivStrategy -> Cxt -> DerivClause data Range FromR :: Exp -> Range FromThenR :: Exp -> Exp -> Range FromToR :: Exp -> Exp -> Range FromThenToR :: Exp -> Exp -> Exp -> Range data Stmt BindS :: Pat -> Exp -> Stmt LetS :: [Dec] -> Stmt NoBindS :: Exp -> Stmt ParS :: [[Stmt]] -> Stmt data Guard -- |
--   f x { | odd x } = x
--   
NormalG :: Exp -> Guard -- |
--   f x { | Just y <- x, Just z <- y } = z
--   
PatG :: [Stmt] -> Guard data Body -- |
--   f p { | e1 = e2
--         | e3 = e4 }
--    where ds
--   
GuardedB :: [(Guard, Exp)] -> Body -- |
--   f p { = e } where ds
--   
NormalB :: Exp -> Body data Lit CharL :: Char -> Lit StringL :: String -> Lit -- | Used for overloaded and non-overloaded literals. We don't have a good -- way to represent non-overloaded literals at the moment. Maybe that -- doesn't matter? IntegerL :: Integer -> Lit RationalL :: Rational -> Lit IntPrimL :: Integer -> Lit WordPrimL :: Integer -> Lit FloatPrimL :: Rational -> Lit DoublePrimL :: Rational -> Lit -- | A primitive C-style string, type Addr# StringPrimL :: [Word8] -> Lit CharPrimL :: Char -> Lit data FixityDirection InfixL :: FixityDirection InfixR :: FixityDirection InfixN :: FixityDirection data Fixity Fixity :: Int -> FixityDirection -> Fixity -- | InstanceDec desribes a single instance of a class or type -- function. It is just a Dec, but guaranteed to be one of the -- following: -- -- type InstanceDec = Dec -- | In PrimTyConI, is the type constructor unlifted? type Unlifted = Bool -- | In PrimTyConI, arity of the type constructor type Arity = Int -- | In UnboxedSumE, UnboxedSumT, and UnboxedSumP, the -- total number of SumAlts. For example, (#|#) has a -- SumArity of 2. type SumArity = Int -- | In UnboxedSumE and UnboxedSumP, the number associated -- with a particular data constructor. SumAlts are one-indexed and -- should never exceed the value of its corresponding SumArity. -- For example: -- -- type SumAlt = Int -- | In ClassOpI and DataConI, name of the parent class or -- type type ParentName = Name -- | Obtained from reifyModule in the Q Monad. data ModuleInfo -- | Contains the import list of the module. ModuleInfo :: [Module] -> ModuleInfo -- | Obtained from reify in the Q Monad. data Info -- | A class, with a list of its visible instances ClassI :: Dec -> [InstanceDec] -> Info -- | A class method ClassOpI :: Name -> Type -> ParentName -> Info -- | A "plain" type constructor. "Fancier" type constructors are returned -- using PrimTyConI or FamilyI as appropriate TyConI :: Dec -> Info -- | A type or data family, with a list of its visible instances. A closed -- type family is returned with 0 instances. FamilyI :: Dec -> [InstanceDec] -> Info -- | A "primitive" type constructor, which can't be expressed with a -- Dec. Examples: (->), Int#. PrimTyConI :: Name -> Arity -> Unlifted -> Info -- | A data constructor DataConI :: Name -> Type -> ParentName -> Info -- | A pattern synonym. PatSynI :: Name -> PatSynType -> Info -- | A "value" variable (as opposed to a type variable, see TyVarI). -- -- The Maybe Dec field contains Just the declaration -- which defined the variable -- including the RHS of the declaration -- -- or else Nothing, in the case where the RHS is unavailable to -- the compiler. At present, this value is _always_ Nothing: -- returning the RHS has not yet been implemented because of lack of -- interest. VarI :: Name -> Type -> Maybe Dec -> Info -- | A type variable. -- -- The Type field contains the type which underlies the -- variable. At present, this is always VarT theName, but -- future changes may permit refinement of this. TyVarI :: Name -> Type -> Info type CharPos = (Int, Int) " Line and character position" data Loc Loc :: String -> String -> String -> CharPos -> CharPos -> Loc [loc_filename] :: Loc -> String [loc_package] :: Loc -> String [loc_module] :: Loc -> String [loc_start] :: Loc -> CharPos [loc_end] :: Loc -> CharPos data NameIs Alone :: NameIs Applied :: NameIs Infix :: NameIs type Uniq = Int data NameSpace -- | Variables VarName :: NameSpace -- | Data constructors DataName :: NameSpace -- | Type constructors and classes; Haskell has them in the same name space -- for now. TcClsName :: NameSpace data NameFlavour -- | An unqualified name; dynamically bound NameS :: NameFlavour -- | A qualified name; dynamically bound NameQ :: ModName -> NameFlavour -- | A unique local name NameU :: !Int -> NameFlavour -- | Local name bound outside of the TH AST NameL :: !Int -> NameFlavour -- | Global name bound outside of the TH AST: An original name (occurrences -- only, not binders) Need the namespace too to be sure which thing we -- are naming NameG :: NameSpace -> PkgName -> ModName -> NameFlavour newtype OccName OccName :: String -> OccName -- | Obtained from reifyModule and thisModule. data Module Module :: PkgName -> ModName -> Module newtype PkgName PkgName :: String -> PkgName newtype ModName ModName :: String -> ModName class (MonadIO m, MonadFail m) => Quasi m qNewName :: Quasi m => String -> m Name qReport :: Quasi m => Bool -> String -> m () qRecover :: Quasi m => m a -> m a -> m a qLookupName :: Quasi m => Bool -> String -> m (Maybe Name) qReify :: Quasi m => Name -> m Info qReifyFixity :: Quasi m => Name -> m (Maybe Fixity) qReifyInstances :: Quasi m => Name -> [Type] -> m [Dec] qReifyRoles :: Quasi m => Name -> m [Role] qReifyAnnotations :: (Quasi m, Data a) => AnnLookup -> m [a] qReifyModule :: Quasi m => Module -> m ModuleInfo qReifyConStrictness :: Quasi m => Name -> m [DecidedStrictness] qLocation :: Quasi m => m Loc qRunIO :: Quasi m => IO a -> m a qAddDependentFile :: Quasi m => FilePath -> m () qAddTempFile :: Quasi m => String -> m FilePath qAddTopDecls :: Quasi m => [Dec] -> m () qAddForeignFilePath :: Quasi m => ForeignSrcLang -> String -> m () qAddModFinalizer :: Quasi m => Q () -> m () qAddCorePlugin :: Quasi m => String -> m () qGetQ :: (Quasi m, Typeable a) => m (Maybe a) qPutQ :: (Quasi m, Typeable a) => a -> m () qIsExtEnabled :: Quasi m => Extension -> m Bool qExtsEnabled :: Quasi m => m [Extension] badIO :: String -> IO a counter :: IORef Int runQ :: Quasi m => Q a -> m a -- | Report an error (True) or warning (False), but carry on; use -- fail to stop. -- | Deprecated: Use reportError or reportWarning instead report :: Bool -> String -> Q () -- | Report an error to the user, but allow the current splice's -- computation to carry on. To abort the computation, use fail. reportError :: String -> Q () -- | Report a warning to the user, and carry on. reportWarning :: String -> Q () -- | Recover from errors raised by reportError or fail. recover :: Q a -> Q a -> Q a lookupName :: Bool -> String -> Q (Maybe Name) -- | Look up the given name in the (type namespace of the) current splice's -- scope. See Language.Haskell.TH.Syntax#namelookup for more -- details. lookupTypeName :: String -> Q (Maybe Name) -- | Look up the given name in the (value namespace of the) current -- splice's scope. See Language.Haskell.TH.Syntax#namelookup for -- more details. lookupValueName :: String -> Q (Maybe Name) -- | reify looks up information about the Name. -- -- It is sometimes useful to construct the argument name using -- lookupTypeName or lookupValueName to ensure that we are -- reifying from the right namespace. For instance, in this context: -- --
--   data D = D
--   
-- -- which D does reify (mkName "D") return information -- about? (Answer: D-the-type, but don't rely on it.) To ensure -- we get information about D-the-value, use -- lookupValueName: -- --
--   do
--     Just nm <- lookupValueName "D"
--     reify nm
--   
-- -- and to get information about D-the-type, use -- lookupTypeName. reify :: Name -> Q Info -- | reifyFixity nm attempts to find a fixity declaration for -- nm. For example, if the function foo has the fixity -- declaration infixr 7 foo, then reifyFixity 'foo -- would return Just (Fixity 7 InfixR). If -- the function bar does not have a fixity declaration, then -- reifyFixity 'bar returns Nothing, so you may assume -- bar has defaultFixity. reifyFixity :: Name -> Q (Maybe Fixity) -- | reifyInstances nm tys returns a list of visible instances of -- nm tys. That is, if nm is the name of a type class, -- then all instances of this class at the types tys are -- returned. Alternatively, if nm is the name of a data family -- or type family, all instances of this family at the types tys -- are returned. reifyInstances :: Name -> [Type] -> Q [InstanceDec] -- | reifyRoles nm returns the list of roles associated with the -- parameters of the tycon nm. Fails if nm cannot be -- found or is not a tycon. The returned list should never contain -- InferR. reifyRoles :: Name -> Q [Role] -- | reifyAnnotations target returns the list of annotations -- associated with target. Only the annotations that are -- appropriately typed is returned. So if you have Int and -- String annotations for the same target, you have to call this -- function twice. reifyAnnotations :: Data a => AnnLookup -> Q [a] -- | reifyModule mod looks up information about module -- mod. To look up the current module, call this function with -- the return value of thisModule. reifyModule :: Module -> Q ModuleInfo -- | reifyConStrictness nm looks up the strictness information for -- the fields of the constructor with the name nm. Note that the -- strictness information that reifyConStrictness returns may not -- correspond to what is written in the source code. For example, in the -- following data declaration: -- --
--   data Pair a = Pair a a
--   
-- -- reifyConStrictness would return [DecidedLazy, -- DecidedLazy] under most circumstances, but it would return -- [DecidedStrict, DecidedStrict] if the -- -XStrictData language extension was enabled. reifyConStrictness :: Name -> Q [DecidedStrictness] -- | Is the list of instances returned by reifyInstances nonempty? isInstance :: Name -> [Type] -> Q Bool -- | The location at which this computation is spliced. location :: Q Loc -- | The runIO function lets you run an I/O computation in the -- Q monad. Take care: you are guaranteed the ordering of calls to -- runIO within a single Q computation, but not about the -- order in which splices are run. -- -- Note: for various murky reasons, stdout and stderr handles are not -- necessarily flushed when the compiler finishes running, so you should -- flush them yourself. runIO :: IO a -> Q a -- | Record external files that runIO is using (dependent upon). The -- compiler can then recognize that it should re-compile the Haskell file -- when an external file changes. -- -- Expects an absolute file path. -- -- Notes: -- -- addDependentFile :: FilePath -> Q () -- | Obtain a temporary file path with the given suffix. The compiler will -- delete this file after compilation. addTempFile :: String -> Q FilePath -- | Add additional top-level declarations. The added declarations will be -- type checked along with the current declaration group. addTopDecls :: [Dec] -> Q () -- | Deprecated: Use addForeignSource instead addForeignFile :: ForeignSrcLang -> String -> Q () -- | Emit a foreign file which will be compiled and linked to the object -- for the current module. Currently only languages that can be compiled -- with the C compiler are supported, and the flags passed as part of -- -optc will be also applied to the C compiler invocation that will -- compile them. -- -- Note that for non-C languages (for example C++) extern -- C directives must be used to get symbols that we can -- access from Haskell. -- -- To get better errors, it is reccomended to use #line pragmas when -- emitting C files, e.g. -- --
--   {-# LANGUAGE CPP #-}
--   ...
--   addForeignSource LangC $ unlines
--     [ "#line " ++ show (__LINE__ + 1) ++ " " ++ show __FILE__
--     , ...
--     ]
--   
addForeignSource :: ForeignSrcLang -> String -> Q () -- | Same as addForeignSource, but expects to receive a path -- pointing to the foreign file instead of a String of its -- contents. Consider using this in conjunction with addTempFile. -- -- This is a good alternative to addForeignSource when you are -- trying to directly link in an object file. addForeignFilePath :: ForeignSrcLang -> FilePath -> Q () -- | Add a finalizer that will run in the Q monad after the current module -- has been type checked. This only makes sense when run within a -- top-level splice. -- -- The finalizer is given the local type environment at the splice point. -- Thus reify is able to find the local definitions when executed -- inside the finalizer. addModFinalizer :: Q () -> Q () -- | Adds a core plugin to the compilation pipeline. -- -- addCorePlugin m has almost the same effect as passing -- -fplugin=m to ghc in the command line. The major difference -- is that the plugin module m must not belong to the current -- package. When TH executes, it is too late to tell the compiler that we -- needed to compile first a plugin module in the current package. addCorePlugin :: String -> Q () -- | Get state from the Q monad. Note that the state is local to the -- Haskell module in which the Template Haskell expression is executed. getQ :: Typeable a => Q (Maybe a) -- | Replace the state in the Q monad. Note that the state is local -- to the Haskell module in which the Template Haskell expression is -- executed. putQ :: Typeable a => a -> Q () -- | Determine whether the given language extension is enabled in the -- Q monad. isExtEnabled :: Extension -> Q Bool -- | List all enabled language extensions. extsEnabled :: Q [Extension] trueName :: Name falseName :: Name nothingName :: Name justName :: Name leftName :: Name rightName :: Name -- | dataToQa is an internal utility function for constructing -- generic conversion functions from types with Data instances to -- various quasi-quoting representations. See the source of -- dataToExpQ and dataToPatQ for two example usages: -- mkCon, mkLit and appQ are overloadable to -- account for different syntax for expressions and patterns; -- antiQ allows you to override type-specific cases, a common -- usage is just const Nothing, which results in no overloading. dataToQa :: forall a k q. Data a => (Name -> k) -> (Lit -> Q q) -> (k -> [Q q] -> Q q) -> (forall b. Data b => b -> Maybe (Q q)) -> a -> Q q -- | dataToExpQ converts a value to a 'Q Exp' representation of the -- same value, in the SYB style. It is generalized to take a function -- override type-specific cases; see liftData for a more commonly -- used variant. dataToExpQ :: Data a => (forall b. Data b => b -> Maybe (Q Exp)) -> a -> Q Exp -- | liftData is a variant of lift in the Lift type -- class which works for any type with a Data instance. liftData :: Data a => a -> Q Exp -- | dataToPatQ converts a value to a 'Q Pat' representation of the -- same value, in the SYB style. It takes a function to handle -- type-specific cases, alternatively, pass const Nothing to get -- default behavior. dataToPatQ :: Data a => (forall b. Data b => b -> Maybe (Q Pat)) -> a -> Q Pat mkModName :: String -> ModName modString :: ModName -> String mkPkgName :: String -> PkgName pkgString :: PkgName -> String mkOccName :: String -> OccName occString :: OccName -> String -- | The name without its module prefix. -- --

Examples

-- --
--   >>> nameBase ''Data.Either.Either
--   "Either"
--   
--   >>> nameBase (mkName "foo")
--   "foo"
--   
--   >>> nameBase (mkName "Module.foo")
--   "foo"
--   
nameBase :: Name -> String -- | Module prefix of a name, if it exists. -- --

Examples

-- --
--   >>> nameModule ''Data.Either.Either
--   Just "Data.Either"
--   
--   >>> nameModule (mkName "foo")
--   Nothing
--   
--   >>> nameModule (mkName "Module.foo")
--   Just "Module"
--   
nameModule :: Name -> Maybe String -- | A name's package, if it exists. -- --

Examples

-- --
--   >>> namePackage ''Data.Either.Either
--   Just "base"
--   
--   >>> namePackage (mkName "foo")
--   Nothing
--   
--   >>> namePackage (mkName "Module.foo")
--   Nothing
--   
namePackage :: Name -> Maybe String -- | Returns whether a name represents an occurrence of a top-level -- variable (VarName), data constructor (DataName), type -- constructor, or type class (TcClsName). If we can't be sure, it -- returns Nothing. -- --

Examples

-- --
--   >>> nameSpace 'Prelude.id
--   Just VarName
--   
--   >>> nameSpace (mkName "id")
--   Nothing -- only works for top-level variable names
--   
--   >>> nameSpace 'Data.Maybe.Just
--   Just DataName
--   
--   >>> nameSpace ''Data.Maybe.Maybe
--   Just TcClsName
--   
--   >>> nameSpace ''Data.Ord.Ord
--   Just TcClsName
--   
nameSpace :: Name -> Maybe NameSpace -- | Only used internally mkNameU :: String -> Uniq -> Name -- | Used for 'x etc, but not available to the programmer mkNameG :: NameSpace -> String -> String -> String -> Name showName :: Name -> String showName' :: NameIs -> Name -> String -- | Tuple data constructor tupleDataName :: Int -> Name -- | Tuple type constructor tupleTypeName :: Int -> Name mk_tup_name :: Int -> NameSpace -> Name -- | Unboxed tuple data constructor unboxedTupleDataName :: Int -> Name -- | Unboxed tuple type constructor unboxedTupleTypeName :: Int -> Name mk_unboxed_tup_name :: Int -> NameSpace -> Name -- | Unboxed sum data constructor unboxedSumDataName :: SumAlt -> SumArity -> Name -- | Unboxed sum type constructor unboxedSumTypeName :: SumArity -> Name -- | Highest allowed operator precedence for Fixity constructor -- (answer: 9) maxPrecedence :: Int -- | Default fixity: infixl 9 defaultFixity :: Fixity cmpEq :: Ordering -> Bool thenCmp :: Ordering -> Ordering -> Ordering data ForeignSrcLang LangC :: ForeignSrcLang LangCxx :: ForeignSrcLang LangObjc :: ForeignSrcLang LangObjcxx :: ForeignSrcLang RawObject :: ForeignSrcLang instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Info instance Data.Data.Data Language.Haskell.TH.Syntax.Info instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Info instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Info instance GHC.Show.Show Language.Haskell.TH.Syntax.Info instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Pragma instance Data.Data.Data Language.Haskell.TH.Syntax.Pragma instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Pragma instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Pragma instance GHC.Show.Show Language.Haskell.TH.Syntax.Pragma instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Pat instance Data.Data.Data Language.Haskell.TH.Syntax.Pat instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Pat instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Pat instance GHC.Show.Show Language.Haskell.TH.Syntax.Pat instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Match instance Data.Data.Data Language.Haskell.TH.Syntax.Match instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Match instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Match instance GHC.Show.Show Language.Haskell.TH.Syntax.Match instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Range instance Data.Data.Data Language.Haskell.TH.Syntax.Range instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Range instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Range instance GHC.Show.Show Language.Haskell.TH.Syntax.Range instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Exp instance Data.Data.Data Language.Haskell.TH.Syntax.Exp instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Exp instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Exp instance GHC.Show.Show Language.Haskell.TH.Syntax.Exp instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Stmt instance Data.Data.Data Language.Haskell.TH.Syntax.Stmt instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Stmt instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Stmt instance GHC.Show.Show Language.Haskell.TH.Syntax.Stmt instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Guard instance Data.Data.Data Language.Haskell.TH.Syntax.Guard instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Guard instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Guard instance GHC.Show.Show Language.Haskell.TH.Syntax.Guard instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Body instance Data.Data.Data Language.Haskell.TH.Syntax.Body instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Body instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Body instance GHC.Show.Show Language.Haskell.TH.Syntax.Body instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Clause instance Data.Data.Data Language.Haskell.TH.Syntax.Clause instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Clause instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Clause instance GHC.Show.Show Language.Haskell.TH.Syntax.Clause instance GHC.Generics.Generic Language.Haskell.TH.Syntax.PatSynDir instance Data.Data.Data Language.Haskell.TH.Syntax.PatSynDir instance GHC.Classes.Ord Language.Haskell.TH.Syntax.PatSynDir instance GHC.Classes.Eq Language.Haskell.TH.Syntax.PatSynDir instance GHC.Show.Show Language.Haskell.TH.Syntax.PatSynDir instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Dec instance Data.Data.Data Language.Haskell.TH.Syntax.Dec instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Dec instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Dec instance GHC.Show.Show Language.Haskell.TH.Syntax.Dec instance GHC.Generics.Generic Language.Haskell.TH.Syntax.DerivClause instance Data.Data.Data Language.Haskell.TH.Syntax.DerivClause instance GHC.Classes.Ord Language.Haskell.TH.Syntax.DerivClause instance GHC.Classes.Eq Language.Haskell.TH.Syntax.DerivClause instance GHC.Show.Show Language.Haskell.TH.Syntax.DerivClause instance GHC.Generics.Generic Language.Haskell.TH.Syntax.DerivStrategy instance Data.Data.Data Language.Haskell.TH.Syntax.DerivStrategy instance GHC.Classes.Ord Language.Haskell.TH.Syntax.DerivStrategy instance GHC.Classes.Eq Language.Haskell.TH.Syntax.DerivStrategy instance GHC.Show.Show Language.Haskell.TH.Syntax.DerivStrategy instance GHC.Generics.Generic Language.Haskell.TH.Syntax.TySynEqn instance Data.Data.Data Language.Haskell.TH.Syntax.TySynEqn instance GHC.Classes.Ord Language.Haskell.TH.Syntax.TySynEqn instance GHC.Classes.Eq Language.Haskell.TH.Syntax.TySynEqn instance GHC.Show.Show Language.Haskell.TH.Syntax.TySynEqn instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Foreign instance Data.Data.Data Language.Haskell.TH.Syntax.Foreign instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Foreign instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Foreign instance GHC.Show.Show Language.Haskell.TH.Syntax.Foreign instance GHC.Generics.Generic Language.Haskell.TH.Syntax.RuleBndr instance Data.Data.Data Language.Haskell.TH.Syntax.RuleBndr instance GHC.Classes.Ord Language.Haskell.TH.Syntax.RuleBndr instance GHC.Classes.Eq Language.Haskell.TH.Syntax.RuleBndr instance GHC.Show.Show Language.Haskell.TH.Syntax.RuleBndr instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Con instance Data.Data.Data Language.Haskell.TH.Syntax.Con instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Con instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Con instance GHC.Show.Show Language.Haskell.TH.Syntax.Con instance GHC.Generics.Generic Language.Haskell.TH.Syntax.TypeFamilyHead instance Data.Data.Data Language.Haskell.TH.Syntax.TypeFamilyHead instance GHC.Classes.Ord Language.Haskell.TH.Syntax.TypeFamilyHead instance GHC.Classes.Eq Language.Haskell.TH.Syntax.TypeFamilyHead instance GHC.Show.Show Language.Haskell.TH.Syntax.TypeFamilyHead instance GHC.Generics.Generic Language.Haskell.TH.Syntax.FamilyResultSig instance Data.Data.Data Language.Haskell.TH.Syntax.FamilyResultSig instance GHC.Classes.Ord Language.Haskell.TH.Syntax.FamilyResultSig instance GHC.Classes.Eq Language.Haskell.TH.Syntax.FamilyResultSig instance GHC.Show.Show Language.Haskell.TH.Syntax.FamilyResultSig instance GHC.Generics.Generic Language.Haskell.TH.Syntax.TyVarBndr instance Data.Data.Data Language.Haskell.TH.Syntax.TyVarBndr instance GHC.Classes.Ord Language.Haskell.TH.Syntax.TyVarBndr instance GHC.Classes.Eq Language.Haskell.TH.Syntax.TyVarBndr instance GHC.Show.Show Language.Haskell.TH.Syntax.TyVarBndr instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Type instance Data.Data.Data Language.Haskell.TH.Syntax.Type instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Type instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Type instance GHC.Show.Show Language.Haskell.TH.Syntax.Type instance GHC.Generics.Generic Language.Haskell.TH.Syntax.AnnLookup instance Data.Data.Data Language.Haskell.TH.Syntax.AnnLookup instance GHC.Classes.Ord Language.Haskell.TH.Syntax.AnnLookup instance GHC.Classes.Eq Language.Haskell.TH.Syntax.AnnLookup instance GHC.Show.Show Language.Haskell.TH.Syntax.AnnLookup instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Role instance Data.Data.Data Language.Haskell.TH.Syntax.Role instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Role instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Role instance GHC.Show.Show Language.Haskell.TH.Syntax.Role instance GHC.Generics.Generic Language.Haskell.TH.Syntax.TyLit instance Data.Data.Data Language.Haskell.TH.Syntax.TyLit instance GHC.Classes.Ord Language.Haskell.TH.Syntax.TyLit instance GHC.Classes.Eq Language.Haskell.TH.Syntax.TyLit instance GHC.Show.Show Language.Haskell.TH.Syntax.TyLit instance GHC.Generics.Generic Language.Haskell.TH.Syntax.InjectivityAnn instance Data.Data.Data Language.Haskell.TH.Syntax.InjectivityAnn instance GHC.Classes.Ord Language.Haskell.TH.Syntax.InjectivityAnn instance GHC.Classes.Eq Language.Haskell.TH.Syntax.InjectivityAnn instance GHC.Show.Show Language.Haskell.TH.Syntax.InjectivityAnn instance GHC.Generics.Generic Language.Haskell.TH.Syntax.PatSynArgs instance Data.Data.Data Language.Haskell.TH.Syntax.PatSynArgs instance GHC.Classes.Ord Language.Haskell.TH.Syntax.PatSynArgs instance GHC.Classes.Eq Language.Haskell.TH.Syntax.PatSynArgs instance GHC.Show.Show Language.Haskell.TH.Syntax.PatSynArgs instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Bang instance Data.Data.Data Language.Haskell.TH.Syntax.Bang instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Bang instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Bang instance GHC.Show.Show Language.Haskell.TH.Syntax.Bang instance GHC.Generics.Generic Language.Haskell.TH.Syntax.DecidedStrictness instance Data.Data.Data Language.Haskell.TH.Syntax.DecidedStrictness instance GHC.Classes.Ord Language.Haskell.TH.Syntax.DecidedStrictness instance GHC.Classes.Eq Language.Haskell.TH.Syntax.DecidedStrictness instance GHC.Show.Show Language.Haskell.TH.Syntax.DecidedStrictness instance GHC.Generics.Generic Language.Haskell.TH.Syntax.SourceStrictness instance Data.Data.Data Language.Haskell.TH.Syntax.SourceStrictness instance GHC.Classes.Ord Language.Haskell.TH.Syntax.SourceStrictness instance GHC.Classes.Eq Language.Haskell.TH.Syntax.SourceStrictness instance GHC.Show.Show Language.Haskell.TH.Syntax.SourceStrictness instance GHC.Generics.Generic Language.Haskell.TH.Syntax.SourceUnpackedness instance Data.Data.Data Language.Haskell.TH.Syntax.SourceUnpackedness instance GHC.Classes.Ord Language.Haskell.TH.Syntax.SourceUnpackedness instance GHC.Classes.Eq Language.Haskell.TH.Syntax.SourceUnpackedness instance GHC.Show.Show Language.Haskell.TH.Syntax.SourceUnpackedness instance GHC.Generics.Generic Language.Haskell.TH.Syntax.AnnTarget instance Data.Data.Data Language.Haskell.TH.Syntax.AnnTarget instance GHC.Classes.Ord Language.Haskell.TH.Syntax.AnnTarget instance GHC.Classes.Eq Language.Haskell.TH.Syntax.AnnTarget instance GHC.Show.Show Language.Haskell.TH.Syntax.AnnTarget instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Phases instance Data.Data.Data Language.Haskell.TH.Syntax.Phases instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Phases instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Phases instance GHC.Show.Show Language.Haskell.TH.Syntax.Phases instance GHC.Generics.Generic Language.Haskell.TH.Syntax.RuleMatch instance Data.Data.Data Language.Haskell.TH.Syntax.RuleMatch instance GHC.Classes.Ord Language.Haskell.TH.Syntax.RuleMatch instance GHC.Classes.Eq Language.Haskell.TH.Syntax.RuleMatch instance GHC.Show.Show Language.Haskell.TH.Syntax.RuleMatch instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Inline instance Data.Data.Data Language.Haskell.TH.Syntax.Inline instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Inline instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Inline instance GHC.Show.Show Language.Haskell.TH.Syntax.Inline instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Safety instance Data.Data.Data Language.Haskell.TH.Syntax.Safety instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Safety instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Safety instance GHC.Show.Show Language.Haskell.TH.Syntax.Safety instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Callconv instance Data.Data.Data Language.Haskell.TH.Syntax.Callconv instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Callconv instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Callconv instance GHC.Show.Show Language.Haskell.TH.Syntax.Callconv instance GHC.Generics.Generic Language.Haskell.TH.Syntax.FunDep instance Data.Data.Data Language.Haskell.TH.Syntax.FunDep instance GHC.Classes.Ord Language.Haskell.TH.Syntax.FunDep instance GHC.Classes.Eq Language.Haskell.TH.Syntax.FunDep instance GHC.Show.Show Language.Haskell.TH.Syntax.FunDep instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Overlap instance Data.Data.Data Language.Haskell.TH.Syntax.Overlap instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Overlap instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Overlap instance GHC.Show.Show Language.Haskell.TH.Syntax.Overlap instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Lit instance Data.Data.Data Language.Haskell.TH.Syntax.Lit instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Lit instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Lit instance GHC.Show.Show Language.Haskell.TH.Syntax.Lit instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Fixity instance Data.Data.Data Language.Haskell.TH.Syntax.Fixity instance GHC.Show.Show Language.Haskell.TH.Syntax.Fixity instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Fixity instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Fixity instance GHC.Generics.Generic Language.Haskell.TH.Syntax.FixityDirection instance Data.Data.Data Language.Haskell.TH.Syntax.FixityDirection instance GHC.Show.Show Language.Haskell.TH.Syntax.FixityDirection instance GHC.Classes.Ord Language.Haskell.TH.Syntax.FixityDirection instance GHC.Classes.Eq Language.Haskell.TH.Syntax.FixityDirection instance GHC.Generics.Generic Language.Haskell.TH.Syntax.ModuleInfo instance Data.Data.Data Language.Haskell.TH.Syntax.ModuleInfo instance GHC.Classes.Ord Language.Haskell.TH.Syntax.ModuleInfo instance GHC.Classes.Eq Language.Haskell.TH.Syntax.ModuleInfo instance GHC.Show.Show Language.Haskell.TH.Syntax.ModuleInfo instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Loc instance Data.Data.Data Language.Haskell.TH.Syntax.Loc instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Loc instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Loc instance GHC.Show.Show Language.Haskell.TH.Syntax.Loc instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Name instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Name instance Data.Data.Data Language.Haskell.TH.Syntax.Name instance GHC.Generics.Generic Language.Haskell.TH.Syntax.NameFlavour instance GHC.Show.Show Language.Haskell.TH.Syntax.NameFlavour instance GHC.Classes.Ord Language.Haskell.TH.Syntax.NameFlavour instance GHC.Classes.Eq Language.Haskell.TH.Syntax.NameFlavour instance Data.Data.Data Language.Haskell.TH.Syntax.NameFlavour instance GHC.Generics.Generic Language.Haskell.TH.Syntax.NameSpace instance Data.Data.Data Language.Haskell.TH.Syntax.NameSpace instance GHC.Show.Show Language.Haskell.TH.Syntax.NameSpace instance GHC.Classes.Ord Language.Haskell.TH.Syntax.NameSpace instance GHC.Classes.Eq Language.Haskell.TH.Syntax.NameSpace instance GHC.Generics.Generic Language.Haskell.TH.Syntax.OccName instance Data.Data.Data Language.Haskell.TH.Syntax.OccName instance GHC.Classes.Ord Language.Haskell.TH.Syntax.OccName instance GHC.Classes.Eq Language.Haskell.TH.Syntax.OccName instance GHC.Show.Show Language.Haskell.TH.Syntax.OccName instance GHC.Generics.Generic Language.Haskell.TH.Syntax.Module instance Data.Data.Data Language.Haskell.TH.Syntax.Module instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Module instance GHC.Classes.Eq Language.Haskell.TH.Syntax.Module instance GHC.Show.Show Language.Haskell.TH.Syntax.Module instance GHC.Generics.Generic Language.Haskell.TH.Syntax.PkgName instance Data.Data.Data Language.Haskell.TH.Syntax.PkgName instance GHC.Classes.Ord Language.Haskell.TH.Syntax.PkgName instance GHC.Classes.Eq Language.Haskell.TH.Syntax.PkgName instance GHC.Show.Show Language.Haskell.TH.Syntax.PkgName instance GHC.Generics.Generic Language.Haskell.TH.Syntax.ModName instance Data.Data.Data Language.Haskell.TH.Syntax.ModName instance GHC.Classes.Ord Language.Haskell.TH.Syntax.ModName instance GHC.Classes.Eq Language.Haskell.TH.Syntax.ModName instance GHC.Show.Show Language.Haskell.TH.Syntax.ModName instance Language.Haskell.TH.Syntax.Lift GHC.Integer.Type.Integer instance Language.Haskell.TH.Syntax.Lift GHC.Types.Int instance Language.Haskell.TH.Syntax.Lift GHC.Int.Int8 instance Language.Haskell.TH.Syntax.Lift GHC.Int.Int16 instance Language.Haskell.TH.Syntax.Lift GHC.Int.Int32 instance Language.Haskell.TH.Syntax.Lift GHC.Int.Int64 instance Language.Haskell.TH.Syntax.Lift GHC.Types.Word instance Language.Haskell.TH.Syntax.Lift GHC.Word.Word8 instance Language.Haskell.TH.Syntax.Lift GHC.Word.Word16 instance Language.Haskell.TH.Syntax.Lift GHC.Word.Word32 instance Language.Haskell.TH.Syntax.Lift GHC.Word.Word64 instance Language.Haskell.TH.Syntax.Lift GHC.Natural.Natural instance GHC.Real.Integral a => Language.Haskell.TH.Syntax.Lift (GHC.Real.Ratio a) instance Language.Haskell.TH.Syntax.Lift GHC.Types.Float instance Language.Haskell.TH.Syntax.Lift GHC.Types.Double instance Language.Haskell.TH.Syntax.Lift GHC.Types.Char instance Language.Haskell.TH.Syntax.Lift GHC.Types.Bool instance Language.Haskell.TH.Syntax.Lift a => Language.Haskell.TH.Syntax.Lift (GHC.Maybe.Maybe a) instance (Language.Haskell.TH.Syntax.Lift a, Language.Haskell.TH.Syntax.Lift b) => Language.Haskell.TH.Syntax.Lift (Data.Either.Either a b) instance Language.Haskell.TH.Syntax.Lift a => Language.Haskell.TH.Syntax.Lift [a] instance Language.Haskell.TH.Syntax.Lift () instance (Language.Haskell.TH.Syntax.Lift a, Language.Haskell.TH.Syntax.Lift b) => Language.Haskell.TH.Syntax.Lift (a, b) instance (Language.Haskell.TH.Syntax.Lift a, Language.Haskell.TH.Syntax.Lift b, Language.Haskell.TH.Syntax.Lift c) => Language.Haskell.TH.Syntax.Lift (a, b, c) instance (Language.Haskell.TH.Syntax.Lift a, Language.Haskell.TH.Syntax.Lift b, Language.Haskell.TH.Syntax.Lift c, Language.Haskell.TH.Syntax.Lift d) => Language.Haskell.TH.Syntax.Lift (a, b, c, d) instance (Language.Haskell.TH.Syntax.Lift a, Language.Haskell.TH.Syntax.Lift b, Language.Haskell.TH.Syntax.Lift c, Language.Haskell.TH.Syntax.Lift d, Language.Haskell.TH.Syntax.Lift e) => Language.Haskell.TH.Syntax.Lift (a, b, c, d, e) instance (Language.Haskell.TH.Syntax.Lift a, Language.Haskell.TH.Syntax.Lift b, Language.Haskell.TH.Syntax.Lift c, Language.Haskell.TH.Syntax.Lift d, Language.Haskell.TH.Syntax.Lift e, Language.Haskell.TH.Syntax.Lift f) => Language.Haskell.TH.Syntax.Lift (a, b, c, d, e, f) instance (Language.Haskell.TH.Syntax.Lift a, Language.Haskell.TH.Syntax.Lift b, Language.Haskell.TH.Syntax.Lift c, Language.Haskell.TH.Syntax.Lift d, Language.Haskell.TH.Syntax.Lift e, Language.Haskell.TH.Syntax.Lift f, Language.Haskell.TH.Syntax.Lift g) => Language.Haskell.TH.Syntax.Lift (a, b, c, d, e, f, g) instance Language.Haskell.TH.Syntax.Quasi GHC.Types.IO instance GHC.Base.Monad Language.Haskell.TH.Syntax.Q instance Control.Monad.Fail.MonadFail Language.Haskell.TH.Syntax.Q instance GHC.Base.Functor Language.Haskell.TH.Syntax.Q instance GHC.Base.Applicative Language.Haskell.TH.Syntax.Q instance Control.Monad.IO.Class.MonadIO Language.Haskell.TH.Syntax.Q instance Language.Haskell.TH.Syntax.Quasi Language.Haskell.TH.Syntax.Q instance GHC.Classes.Ord Language.Haskell.TH.Syntax.Name instance GHC.Show.Show Language.Haskell.TH.Syntax.Name -- | Template Haskell supports quasiquoting, which permits users to -- construct program fragments by directly writing concrete syntax. A -- quasiquoter is essentially a function with takes a string to a -- Template Haskell AST. This module defines the QuasiQuoter -- datatype, which specifies a quasiquoter q which can be -- invoked using the syntax [q| ... string to parse ... |] when -- the QuasiQuotes language extension is enabled, and some -- utility functions for manipulating quasiquoters. Nota bene: this -- package does not define any parsers, that is up to you. module Language.Haskell.TH.Quote -- | The QuasiQuoter type, a value q of this type can be -- used in the syntax [q| ... string to parse ...|]. In fact, -- for convenience, a QuasiQuoter actually defines multiple -- quasiquoters to be used in different splice contexts; if you are only -- interested in defining a quasiquoter to be used for expressions, you -- would define a QuasiQuoter with only quoteExp, and leave -- the other fields stubbed out with errors. data QuasiQuoter QuasiQuoter :: (String -> Q Exp) -> (String -> Q Pat) -> (String -> Q Type) -> (String -> Q [Dec]) -> QuasiQuoter -- | Quasi-quoter for expressions, invoked by quotes like lhs = -- $[q|...] [quoteExp] :: QuasiQuoter -> String -> Q Exp -- | Quasi-quoter for patterns, invoked by quotes like f $[q|...] = -- rhs [quotePat] :: QuasiQuoter -> String -> Q Pat -- | Quasi-quoter for types, invoked by quotes like f :: $[q|...] [quoteType] :: QuasiQuoter -> String -> Q Type -- | Quasi-quoter for declarations, invoked by top-level quotes [quoteDec] :: QuasiQuoter -> String -> Q [Dec] -- | quoteFile takes a QuasiQuoter and lifts it into one that -- read the data out of a file. For example, suppose asmq is an -- assembly-language quoter, so that you can write [asmq| ld r1, r2 |] as -- an expression. Then if you define asmq_f = quoteFile asmq, -- then the quote [asmq_f|foo.s|] will take input from file -- "foo.s" instead of the inline text quoteFile :: QuasiQuoter -> QuasiQuoter -- | dataToQa is an internal utility function for constructing -- generic conversion functions from types with Data instances to -- various quasi-quoting representations. See the source of -- dataToExpQ and dataToPatQ for two example usages: -- mkCon, mkLit and appQ are overloadable to -- account for different syntax for expressions and patterns; -- antiQ allows you to override type-specific cases, a common -- usage is just const Nothing, which results in no overloading. dataToQa :: forall a k q. Data a => (Name -> k) -> (Lit -> Q q) -> (k -> [Q q] -> Q q) -> (forall b. Data b => b -> Maybe (Q q)) -> a -> Q q -- | dataToExpQ converts a value to a 'Q Exp' representation of the -- same value, in the SYB style. It is generalized to take a function -- override type-specific cases; see liftData for a more commonly -- used variant. dataToExpQ :: Data a => (forall b. Data b => b -> Maybe (Q Exp)) -> a -> Q Exp -- | dataToPatQ converts a value to a 'Q Pat' representation of the -- same value, in the SYB style. It takes a function to handle -- type-specific cases, alternatively, pass const Nothing to get -- default behavior. dataToPatQ :: Data a => (forall b. Data b => b -> Maybe (Q Pat)) -> a -> Q Pat -- | Monadic front-end to Text.PrettyPrint module Language.Haskell.TH.PprLib type Doc = PprM Doc data PprM a -- | An empty document empty :: Doc -- | A ';' character semi :: Doc -- | A ',' character comma :: Doc -- | A : character colon :: Doc -- | A "::" string dcolon :: Doc -- | A space character space :: Doc -- | A '=' character equals :: Doc -- | A "->" string arrow :: Doc -- | A '(' character lparen :: Doc -- | A ')' character rparen :: Doc -- | A '[' character lbrack :: Doc -- | A ']' character rbrack :: Doc -- | A '{' character lbrace :: Doc -- | A '}' character rbrace :: Doc text :: String -> Doc char :: Char -> Doc ptext :: String -> Doc int :: Int -> Doc integer :: Integer -> Doc float :: Float -> Doc double :: Double -> Doc rational :: Rational -> Doc -- | Wrap document in (...) parens :: Doc -> Doc -- | Wrap document in [...] brackets :: Doc -> Doc -- | Wrap document in {...} braces :: Doc -> Doc -- | Wrap document in '...' quotes :: Doc -> Doc -- | Wrap document in "..." doubleQuotes :: Doc -> Doc -- | Beside (<>) :: Doc -> Doc -> Doc infixl 6 <> -- | Beside, separated by space (<+>) :: Doc -> Doc -> Doc infixl 6 <+> -- | List version of <> hcat :: [Doc] -> Doc -- | List version of <+> hsep :: [Doc] -> Doc -- | Above; if there is no overlap it "dovetails" the two ($$) :: Doc -> Doc -> Doc infixl 5 $$ -- | Above, without dovetailing. ($+$) :: Doc -> Doc -> Doc infixl 5 $+$ -- | List version of $$ vcat :: [Doc] -> Doc -- | Either hsep or vcat sep :: [Doc] -> Doc -- | Either hcat or vcat cat :: [Doc] -> Doc -- | "Paragraph fill" version of sep fsep :: [Doc] -> Doc -- | "Paragraph fill" version of cat fcat :: [Doc] -> Doc -- | Nested nest :: Int -> Doc -> Doc -- |
--   hang d1 n d2 = sep [d1, nest n d2]
--   
hang :: Doc -> Int -> Doc -> Doc punctuate :: Doc -> [Doc] -> [Doc] -- | Returns True if the document is empty isEmpty :: Doc -> PprM Bool to_HPJ_Doc :: Doc -> Doc pprName :: Name -> Doc pprName' :: NameIs -> Name -> Doc instance GHC.Show.Show Language.Haskell.TH.PprLib.Doc instance GHC.Base.Functor Language.Haskell.TH.PprLib.PprM instance GHC.Base.Applicative Language.Haskell.TH.PprLib.PprM instance GHC.Base.Monad Language.Haskell.TH.PprLib.PprM -- | contains a prettyprinter for the Template Haskell datatypes module Language.Haskell.TH.Ppr nestDepth :: Int type Precedence = Int appPrec :: Precedence opPrec :: Precedence unopPrec :: Precedence sigPrec :: Precedence noPrec :: Precedence parensIf :: Bool -> Doc -> Doc pprint :: Ppr a => a -> String class Ppr a ppr :: Ppr a => a -> Doc ppr_list :: Ppr a => [a] -> Doc ppr_sig :: Name -> Type -> Doc pprFixity :: Name -> Fixity -> Doc -- | Pretty prints a pattern synonym type signature pprPatSynSig :: Name -> PatSynType -> Doc -- | Pretty prints a pattern synonym's type; follows the usual conventions -- to print a pattern synonym type compactly, yet unambiguously. See the -- note on PatSynType and the section on pattern synonyms in the -- GHC user's guide for more information. pprPatSynType :: PatSynType -> Doc pprPrefixOcc :: Name -> Doc isSymOcc :: Name -> Bool pprInfixExp :: Exp -> Doc pprExp :: Precedence -> Exp -> Doc pprFields :: [(Name, Exp)] -> Doc pprMaybeExp :: Precedence -> Maybe Exp -> Doc pprMatchPat :: Pat -> Doc pprGuarded :: Doc -> (Guard, Exp) -> Doc pprBody :: Bool -> Body -> Doc pprLit :: Precedence -> Lit -> Doc bytesToString :: [Word8] -> String pprString :: String -> Doc pprPat :: Precedence -> Pat -> Doc ppr_dec :: Bool -> Dec -> Doc ppr_deriv_strategy :: DerivStrategy -> Doc ppr_overlap :: Overlap -> Doc ppr_data :: Doc -> Cxt -> Name -> Doc -> Maybe Kind -> [Con] -> [DerivClause] -> Doc ppr_newtype :: Doc -> Cxt -> Name -> Doc -> Maybe Kind -> Con -> [DerivClause] -> Doc ppr_deriv_clause :: DerivClause -> Doc ppr_tySyn :: Doc -> Name -> Doc -> Type -> Doc ppr_tf_head :: TypeFamilyHead -> Doc commaSepApplied :: [Name] -> Doc pprForall :: [TyVarBndr] -> Cxt -> Doc pprRecFields :: [(Name, Strict, Type)] -> Type -> Doc pprGadtRHS :: [(Strict, Type)] -> Type -> Doc pprVarBangType :: VarBangType -> Doc pprBangType :: BangType -> Doc -- | Deprecated: As of template-haskell-2.11.0.0, -- VarStrictType has been replaced by VarBangType. Please -- use pprVarBangType instead. pprVarStrictType :: (Name, Strict, Type) -> Doc -- | Deprecated: As of template-haskell-2.11.0.0, -- StrictType has been replaced by BangType. Please use -- pprBangType instead. pprStrictType :: (Strict, Type) -> Doc pprParendType :: Type -> Doc pprUInfixT :: Type -> Doc pprTyApp :: (Type, [Type]) -> Doc pprFunArgType :: Type -> Doc split :: Type -> (Type, [Type]) pprTyLit :: TyLit -> Doc pprCxt :: Cxt -> Doc ppr_cxt_preds :: Cxt -> Doc where_clause :: [Dec] -> Doc showtextl :: Show a => a -> Doc hashParens :: Doc -> Doc quoteParens :: Doc -> Doc commaSep :: Ppr a => [a] -> Doc commaSepWith :: (a -> Doc) -> [a] -> Doc semiSep :: Ppr a => [a] -> Doc unboxedSumBars :: Doc -> SumAlt -> SumArity -> Doc bar :: Doc instance Language.Haskell.TH.Ppr.Ppr a => Language.Haskell.TH.Ppr.Ppr [a] instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Name instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Info instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Module instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.ModuleInfo instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Exp instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Stmt instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Match instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Lit instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Pat instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Dec instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.FunDep instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.FamilyResultSig instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.InjectivityAnn instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Foreign instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Pragma instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Inline instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.RuleMatch instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Phases instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.RuleBndr instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Clause instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Con instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.PatSynDir instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.PatSynArgs instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Bang instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.SourceUnpackedness instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.SourceStrictness instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.DecidedStrictness instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Type instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.TyLit instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.TyVarBndr instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Role instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Range instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.Syntax.Loc -- | 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. module Language.Haskell.TH.Lib.Internal type InfoQ = Q Info type PatQ = Q Pat type FieldPatQ = Q FieldPat 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 TyVarBndrQ = Q TyVarBndr 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 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 rationalL :: Rational -> Lit litP :: Lit -> PatQ varP :: Name -> PatQ tupP :: [PatQ] -> PatQ unboxedTupP :: [PatQ] -> PatQ unboxedSumP :: PatQ -> SumAlt -> SumArity -> PatQ conP :: Name -> [PatQ] -> PatQ infixP :: PatQ -> Name -> PatQ -> PatQ uInfixP :: PatQ -> Name -> PatQ -> PatQ parensP :: PatQ -> PatQ tildeP :: PatQ -> PatQ bangP :: PatQ -> PatQ asP :: Name -> PatQ -> PatQ wildP :: PatQ recP :: Name -> [FieldPatQ] -> PatQ listP :: [PatQ] -> PatQ sigP :: PatQ -> TypeQ -> PatQ viewP :: ExpQ -> PatQ -> PatQ fieldPat :: Name -> PatQ -> FieldPatQ bindS :: PatQ -> ExpQ -> StmtQ letS :: [DecQ] -> StmtQ noBindS :: ExpQ -> StmtQ parS :: [[StmtQ]] -> StmtQ fromR :: ExpQ -> RangeQ fromThenR :: ExpQ -> ExpQ -> RangeQ fromToR :: ExpQ -> ExpQ -> RangeQ fromThenToR :: ExpQ -> ExpQ -> ExpQ -> RangeQ normalB :: ExpQ -> BodyQ guardedB :: [Q (Guard, Exp)] -> BodyQ normalG :: ExpQ -> GuardQ normalGE :: ExpQ -> ExpQ -> Q (Guard, Exp) patG :: [StmtQ] -> GuardQ patGE :: [StmtQ] -> ExpQ -> Q (Guard, Exp) -- | Use with caseE match :: PatQ -> BodyQ -> [DecQ] -> MatchQ -- | Use with funD clause :: [PatQ] -> BodyQ -> [DecQ] -> ClauseQ -- | Dynamically binding a variable (unhygenic) dyn :: String -> ExpQ varE :: Name -> ExpQ conE :: Name -> ExpQ litE :: Lit -> ExpQ appE :: ExpQ -> ExpQ -> ExpQ appTypeE :: ExpQ -> TypeQ -> ExpQ parensE :: ExpQ -> ExpQ uInfixE :: ExpQ -> ExpQ -> ExpQ -> ExpQ infixE :: Maybe ExpQ -> ExpQ -> Maybe ExpQ -> ExpQ infixApp :: ExpQ -> ExpQ -> ExpQ -> ExpQ sectionL :: ExpQ -> ExpQ -> ExpQ sectionR :: ExpQ -> ExpQ -> ExpQ lamE :: [PatQ] -> ExpQ -> ExpQ -- | Single-arg lambda lam1E :: PatQ -> ExpQ -> ExpQ lamCaseE :: [MatchQ] -> ExpQ tupE :: [ExpQ] -> ExpQ unboxedTupE :: [ExpQ] -> ExpQ unboxedSumE :: ExpQ -> SumAlt -> SumArity -> ExpQ condE :: ExpQ -> ExpQ -> ExpQ -> ExpQ multiIfE :: [Q (Guard, Exp)] -> ExpQ letE :: [DecQ] -> ExpQ -> ExpQ caseE :: ExpQ -> [MatchQ] -> ExpQ doE :: [StmtQ] -> ExpQ compE :: [StmtQ] -> ExpQ arithSeqE :: RangeQ -> ExpQ listE :: [ExpQ] -> ExpQ sigE :: ExpQ -> TypeQ -> ExpQ recConE :: Name -> [Q (Name, Exp)] -> ExpQ recUpdE :: ExpQ -> [Q (Name, Exp)] -> ExpQ stringE :: String -> ExpQ fieldExp :: Name -> ExpQ -> Q (Name, Exp) -- |
--   staticE x = [| static x |]
--   
staticE :: ExpQ -> ExpQ unboundVarE :: Name -> ExpQ labelE :: String -> ExpQ fromE :: ExpQ -> ExpQ fromThenE :: ExpQ -> ExpQ -> ExpQ fromToE :: ExpQ -> ExpQ -> ExpQ fromThenToE :: ExpQ -> ExpQ -> ExpQ -> ExpQ valD :: PatQ -> BodyQ -> [DecQ] -> DecQ funD :: Name -> [ClauseQ] -> DecQ tySynD :: Name -> [TyVarBndrQ] -> TypeQ -> DecQ dataD :: CxtQ -> Name -> [TyVarBndrQ] -> Maybe KindQ -> [ConQ] -> [DerivClauseQ] -> DecQ newtypeD :: CxtQ -> Name -> [TyVarBndrQ] -> Maybe KindQ -> ConQ -> [DerivClauseQ] -> DecQ classD :: CxtQ -> Name -> [TyVarBndrQ] -> [FunDep] -> [DecQ] -> DecQ instanceD :: CxtQ -> TypeQ -> [DecQ] -> DecQ instanceWithOverlapD :: Maybe Overlap -> CxtQ -> TypeQ -> [DecQ] -> DecQ sigD :: Name -> TypeQ -> DecQ forImpD :: Callconv -> Safety -> String -> Name -> TypeQ -> DecQ infixLD :: Int -> Name -> DecQ infixRD :: Int -> Name -> DecQ infixND :: Int -> Name -> DecQ pragInlD :: Name -> Inline -> RuleMatch -> Phases -> DecQ pragSpecD :: Name -> TypeQ -> Phases -> DecQ pragSpecInlD :: Name -> TypeQ -> Inline -> Phases -> DecQ pragSpecInstD :: TypeQ -> DecQ pragRuleD :: String -> [RuleBndrQ] -> ExpQ -> ExpQ -> Phases -> DecQ pragAnnD :: AnnTarget -> ExpQ -> DecQ pragLineD :: Int -> String -> DecQ pragCompleteD :: [Name] -> Maybe Name -> DecQ dataInstD :: CxtQ -> Name -> [TypeQ] -> Maybe KindQ -> [ConQ] -> [DerivClauseQ] -> DecQ newtypeInstD :: CxtQ -> Name -> [TypeQ] -> Maybe KindQ -> ConQ -> [DerivClauseQ] -> DecQ tySynInstD :: Name -> TySynEqnQ -> DecQ dataFamilyD :: Name -> [TyVarBndrQ] -> Maybe KindQ -> DecQ openTypeFamilyD :: Name -> [TyVarBndrQ] -> FamilyResultSigQ -> Maybe InjectivityAnn -> DecQ closedTypeFamilyD :: Name -> [TyVarBndrQ] -> FamilyResultSigQ -> Maybe InjectivityAnn -> [TySynEqnQ] -> DecQ roleAnnotD :: Name -> [Role] -> DecQ standaloneDerivD :: CxtQ -> TypeQ -> DecQ standaloneDerivWithStrategyD :: Maybe DerivStrategyQ -> CxtQ -> TypeQ -> DecQ defaultSigD :: Name -> TypeQ -> DecQ -- | Pattern synonym declaration patSynD :: Name -> PatSynArgsQ -> PatSynDirQ -> PatQ -> DecQ -- | Pattern synonym type signature patSynSigD :: Name -> TypeQ -> DecQ tySynEqn :: [TypeQ] -> TypeQ -> TySynEqnQ cxt :: [PredQ] -> CxtQ derivClause :: Maybe DerivStrategyQ -> [PredQ] -> DerivClauseQ stockStrategy :: DerivStrategyQ anyclassStrategy :: DerivStrategyQ newtypeStrategy :: DerivStrategyQ viaStrategy :: TypeQ -> DerivStrategyQ normalC :: Name -> [BangTypeQ] -> ConQ recC :: Name -> [VarBangTypeQ] -> ConQ infixC :: Q (Bang, Type) -> Name -> Q (Bang, Type) -> ConQ forallC :: [TyVarBndrQ] -> CxtQ -> ConQ -> ConQ gadtC :: [Name] -> [StrictTypeQ] -> TypeQ -> ConQ recGadtC :: [Name] -> [VarStrictTypeQ] -> TypeQ -> ConQ forallT :: [TyVarBndrQ] -> CxtQ -> TypeQ -> TypeQ varT :: Name -> TypeQ conT :: Name -> TypeQ infixT :: TypeQ -> Name -> TypeQ -> TypeQ uInfixT :: TypeQ -> Name -> TypeQ -> TypeQ parensT :: TypeQ -> TypeQ appT :: TypeQ -> TypeQ -> TypeQ arrowT :: TypeQ listT :: TypeQ litT :: TyLitQ -> TypeQ tupleT :: Int -> TypeQ unboxedTupleT :: Int -> TypeQ unboxedSumT :: SumArity -> TypeQ sigT :: TypeQ -> KindQ -> TypeQ equalityT :: TypeQ wildCardT :: TypeQ -- | Deprecated: As of template-haskell-2.10, constraint predicates -- (Pred) are just types (Type), in keeping with ConstraintKinds. Please -- use conT and appT. 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 -- see equalityT. equalP :: TypeQ -> TypeQ -> PredQ promotedT :: Name -> TypeQ promotedTupleT :: Int -> TypeQ promotedNilT :: TypeQ promotedConsT :: TypeQ noSourceUnpackedness :: SourceUnpackednessQ sourceNoUnpack :: SourceUnpackednessQ sourceUnpack :: SourceUnpackednessQ noSourceStrictness :: SourceStrictnessQ sourceLazy :: SourceStrictnessQ sourceStrict :: SourceStrictnessQ -- | Deprecated: Use bang. See -- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. Example -- usage: 'bang noSourceUnpackedness sourceStrict' isStrict :: Q Strict -- | Deprecated: Use bang. See -- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. Example -- usage: 'bang noSourceUnpackedness noSourceStrictness' notStrict :: Q Strict -- | Deprecated: Use bang. See -- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. Example -- usage: 'bang sourceUnpack sourceStrict' unpacked :: Q Strict bang :: SourceUnpackednessQ -> SourceStrictnessQ -> BangQ bangType :: BangQ -> TypeQ -> BangTypeQ varBangType :: Name -> BangTypeQ -> VarBangTypeQ -- | Deprecated: As of template-haskell-2.11.0.0, -- StrictType has been replaced by BangType. Please use -- bangType instead. strictType :: Q Strict -> TypeQ -> StrictTypeQ -- | Deprecated: As of template-haskell-2.11.0.0, -- VarStrictType has been replaced by VarBangType. Please -- use varBangType instead. varStrictType :: Name -> StrictTypeQ -> VarStrictTypeQ numTyLit :: Integer -> TyLitQ strTyLit :: String -> TyLitQ plainTV :: Name -> TyVarBndrQ kindedTV :: Name -> KindQ -> TyVarBndrQ varK :: Name -> Kind conK :: Name -> Kind tupleK :: Int -> Kind arrowK :: Kind listK :: Kind appK :: Kind -> Kind -> Kind starK :: KindQ constraintK :: KindQ noSig :: FamilyResultSigQ kindSig :: KindQ -> FamilyResultSigQ tyVarSig :: TyVarBndrQ -> FamilyResultSigQ 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 :: Name -> RuleBndrQ typedRuleVar :: Name -> TypeQ -> RuleBndrQ valueAnnotation :: Name -> AnnTarget typeAnnotation :: Name -> AnnTarget moduleAnnotation :: AnnTarget unidir :: PatSynDirQ implBidir :: PatSynDirQ explBidir :: [ClauseQ] -> PatSynDirQ prefixPatSyn :: [Name] -> PatSynArgsQ recordPatSyn :: [Name] -> PatSynArgsQ infixPatSyn :: Name -> Name -> PatSynArgsQ appsE :: [ExpQ] -> ExpQ -- | Return the Module at the place of splicing. Can be used as an input -- for reifyModule. thisModule :: Q Module -- | Language.Haskell.TH.Lib contains lots of useful helper functions for -- generating and manipulating Template Haskell terms module Language.Haskell.TH.Lib type InfoQ = Q Info 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 TyVarBndrQ = Q TyVarBndr 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 PatQ = Q Pat type FieldPatQ = Q FieldPat type RuleBndrQ = Q RuleBndr type TySynEqnQ = Q TySynEqn type PatSynDirQ = Q PatSynDir type PatSynArgsQ = Q PatSynArgs type FamilyResultSigQ = Q FamilyResultSig type DerivStrategyQ = Q DerivStrategy intPrimL :: Integer -> Lit wordPrimL :: Integer -> Lit floatPrimL :: Rational -> Lit doublePrimL :: Rational -> Lit integerL :: Integer -> Lit rationalL :: Rational -> Lit charL :: Char -> Lit stringL :: String -> Lit stringPrimL :: [Word8] -> Lit charPrimL :: Char -> Lit litP :: Lit -> PatQ varP :: Name -> PatQ tupP :: [PatQ] -> PatQ unboxedTupP :: [PatQ] -> PatQ unboxedSumP :: PatQ -> SumAlt -> SumArity -> PatQ conP :: Name -> [PatQ] -> PatQ uInfixP :: PatQ -> Name -> PatQ -> PatQ parensP :: PatQ -> PatQ infixP :: PatQ -> Name -> PatQ -> PatQ tildeP :: PatQ -> PatQ bangP :: PatQ -> PatQ asP :: Name -> PatQ -> PatQ wildP :: PatQ recP :: Name -> [FieldPatQ] -> PatQ listP :: [PatQ] -> PatQ sigP :: PatQ -> TypeQ -> PatQ viewP :: ExpQ -> PatQ -> PatQ fieldPat :: Name -> PatQ -> FieldPatQ normalB :: ExpQ -> BodyQ guardedB :: [Q (Guard, Exp)] -> BodyQ normalG :: ExpQ -> GuardQ normalGE :: ExpQ -> ExpQ -> Q (Guard, Exp) patG :: [StmtQ] -> GuardQ patGE :: [StmtQ] -> ExpQ -> Q (Guard, Exp) -- | Use with caseE match :: PatQ -> BodyQ -> [DecQ] -> MatchQ -- | Use with funD clause :: [PatQ] -> BodyQ -> [DecQ] -> ClauseQ -- | Dynamically binding a variable (unhygenic) dyn :: String -> ExpQ varE :: Name -> ExpQ unboundVarE :: Name -> ExpQ labelE :: String -> ExpQ conE :: Name -> ExpQ litE :: Lit -> ExpQ appE :: ExpQ -> ExpQ -> ExpQ appTypeE :: ExpQ -> TypeQ -> ExpQ uInfixE :: ExpQ -> ExpQ -> ExpQ -> ExpQ parensE :: ExpQ -> ExpQ -- |
--   staticE x = [| static x |]
--   
staticE :: ExpQ -> ExpQ infixE :: Maybe ExpQ -> ExpQ -> Maybe ExpQ -> ExpQ infixApp :: ExpQ -> ExpQ -> ExpQ -> ExpQ sectionL :: ExpQ -> ExpQ -> ExpQ sectionR :: ExpQ -> ExpQ -> ExpQ lamE :: [PatQ] -> ExpQ -> ExpQ -- | Single-arg lambda lam1E :: PatQ -> ExpQ -> ExpQ lamCaseE :: [MatchQ] -> ExpQ tupE :: [ExpQ] -> ExpQ unboxedTupE :: [ExpQ] -> ExpQ unboxedSumE :: ExpQ -> SumAlt -> SumArity -> ExpQ condE :: ExpQ -> ExpQ -> ExpQ -> ExpQ multiIfE :: [Q (Guard, Exp)] -> ExpQ letE :: [DecQ] -> ExpQ -> ExpQ caseE :: ExpQ -> [MatchQ] -> ExpQ appsE :: [ExpQ] -> ExpQ listE :: [ExpQ] -> ExpQ sigE :: ExpQ -> TypeQ -> ExpQ recConE :: Name -> [Q (Name, Exp)] -> ExpQ recUpdE :: ExpQ -> [Q (Name, Exp)] -> ExpQ stringE :: String -> ExpQ fieldExp :: Name -> ExpQ -> Q (Name, Exp) fromE :: ExpQ -> ExpQ fromThenE :: ExpQ -> ExpQ -> ExpQ fromToE :: ExpQ -> ExpQ -> ExpQ fromThenToE :: ExpQ -> ExpQ -> ExpQ -> ExpQ arithSeqE :: RangeQ -> ExpQ fromR :: ExpQ -> RangeQ fromThenR :: ExpQ -> ExpQ -> RangeQ fromToR :: ExpQ -> ExpQ -> RangeQ fromThenToR :: ExpQ -> ExpQ -> ExpQ -> RangeQ doE :: [StmtQ] -> ExpQ compE :: [StmtQ] -> ExpQ bindS :: PatQ -> ExpQ -> StmtQ letS :: [DecQ] -> StmtQ noBindS :: ExpQ -> StmtQ parS :: [[StmtQ]] -> StmtQ forallT :: [TyVarBndr] -> CxtQ -> TypeQ -> TypeQ varT :: Name -> TypeQ conT :: Name -> TypeQ appT :: TypeQ -> TypeQ -> TypeQ arrowT :: TypeQ infixT :: TypeQ -> Name -> TypeQ -> TypeQ uInfixT :: TypeQ -> Name -> TypeQ -> TypeQ parensT :: TypeQ -> TypeQ equalityT :: TypeQ listT :: TypeQ tupleT :: Int -> TypeQ unboxedTupleT :: Int -> TypeQ unboxedSumT :: SumArity -> TypeQ sigT :: TypeQ -> Kind -> TypeQ litT :: TyLitQ -> TypeQ wildCardT :: TypeQ promotedT :: Name -> TypeQ promotedTupleT :: Int -> TypeQ promotedNilT :: TypeQ promotedConsT :: TypeQ numTyLit :: Integer -> TyLitQ strTyLit :: String -> TyLitQ noSourceUnpackedness :: SourceUnpackednessQ sourceNoUnpack :: SourceUnpackednessQ sourceUnpack :: SourceUnpackednessQ noSourceStrictness :: SourceStrictnessQ sourceLazy :: SourceStrictnessQ sourceStrict :: SourceStrictnessQ -- | Deprecated: Use bang. See -- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. Example -- usage: 'bang noSourceUnpackedness sourceStrict' isStrict :: Q Strict -- | Deprecated: Use bang. See -- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. Example -- usage: 'bang noSourceUnpackedness noSourceStrictness' notStrict :: Q Strict -- | Deprecated: Use bang. See -- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. Example -- usage: 'bang sourceUnpack sourceStrict' unpacked :: Q Strict bang :: SourceUnpackednessQ -> SourceStrictnessQ -> BangQ bangType :: BangQ -> TypeQ -> BangTypeQ varBangType :: Name -> BangTypeQ -> VarBangTypeQ -- | Deprecated: As of template-haskell-2.11.0.0, -- StrictType has been replaced by BangType. Please use -- bangType instead. strictType :: Q Strict -> TypeQ -> StrictTypeQ -- | Deprecated: As of template-haskell-2.11.0.0, -- VarStrictType has been replaced by VarBangType. Please -- use varBangType instead. varStrictType :: Name -> StrictTypeQ -> VarStrictTypeQ cxt :: [PredQ] -> CxtQ -- | Deprecated: As of template-haskell-2.10, constraint predicates -- (Pred) are just types (Type), in keeping with ConstraintKinds. Please -- use conT and appT. 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 -- see equalityT. equalP :: TypeQ -> TypeQ -> PredQ normalC :: Name -> [BangTypeQ] -> ConQ recC :: Name -> [VarBangTypeQ] -> ConQ infixC :: Q (Bang, Type) -> Name -> Q (Bang, Type) -> ConQ forallC :: [TyVarBndr] -> CxtQ -> ConQ -> ConQ gadtC :: [Name] -> [StrictTypeQ] -> TypeQ -> ConQ recGadtC :: [Name] -> [VarStrictTypeQ] -> TypeQ -> ConQ varK :: Name -> Kind conK :: Name -> Kind tupleK :: Int -> Kind arrowK :: Kind listK :: Kind appK :: Kind -> Kind -> Kind starK :: Kind constraintK :: Kind plainTV :: Name -> TyVarBndr kindedTV :: Name -> Kind -> TyVarBndr nominalR :: Role representationalR :: Role phantomR :: Role inferR :: Role valD :: PatQ -> BodyQ -> [DecQ] -> DecQ funD :: Name -> [ClauseQ] -> DecQ tySynD :: Name -> [TyVarBndr] -> TypeQ -> DecQ dataD :: CxtQ -> Name -> [TyVarBndr] -> Maybe Kind -> [ConQ] -> [DerivClauseQ] -> DecQ newtypeD :: CxtQ -> Name -> [TyVarBndr] -> Maybe Kind -> ConQ -> [DerivClauseQ] -> DecQ derivClause :: Maybe DerivStrategy -> [PredQ] -> DerivClauseQ -- | A single deriving clause at the end of a datatype. data DerivClause -- |
--   { deriving stock (Eq, Ord) }
--   
DerivClause :: Maybe DerivStrategy -> Cxt -> DerivClause stockStrategy :: DerivStrategyQ anyclassStrategy :: DerivStrategyQ newtypeStrategy :: DerivStrategyQ viaStrategy :: TypeQ -> DerivStrategyQ -- | What the user explicitly requests when deriving an instance. data DerivStrategy -- | A "standard" derived instance StockStrategy :: DerivStrategy -- |
--   -XDeriveAnyClass
--   
AnyclassStrategy :: DerivStrategy -- |
--   -XGeneralizedNewtypeDeriving
--   
NewtypeStrategy :: DerivStrategy -- |
--   -XDerivingVia
--   
ViaStrategy :: Type -> DerivStrategy classD :: CxtQ -> Name -> [TyVarBndr] -> [FunDep] -> [DecQ] -> DecQ instanceD :: CxtQ -> TypeQ -> [DecQ] -> DecQ instanceWithOverlapD :: Maybe Overlap -> CxtQ -> TypeQ -> [DecQ] -> DecQ -- | Varieties of allowed instance overlap. data Overlap -- | May be overlapped by more specific instances Overlappable :: Overlap -- | May overlap a more general instance Overlapping :: Overlap -- | Both Overlapping and Overlappable Overlaps :: Overlap -- | Both Overlappable and Overlappable, and pick an -- arbitrary one if multiple choices are available. Incoherent :: Overlap sigD :: Name -> TypeQ -> DecQ standaloneDerivD :: CxtQ -> TypeQ -> DecQ standaloneDerivWithStrategyD :: Maybe DerivStrategy -> CxtQ -> TypeQ -> DecQ defaultSigD :: Name -> TypeQ -> DecQ roleAnnotD :: Name -> [Role] -> DecQ dataFamilyD :: Name -> [TyVarBndr] -> Maybe Kind -> DecQ openTypeFamilyD :: Name -> [TyVarBndr] -> FamilyResultSig -> Maybe InjectivityAnn -> DecQ closedTypeFamilyD :: Name -> [TyVarBndr] -> FamilyResultSig -> Maybe InjectivityAnn -> [TySynEqnQ] -> DecQ dataInstD :: CxtQ -> Name -> [TypeQ] -> Maybe Kind -> [ConQ] -> [DerivClauseQ] -> DecQ newtypeInstD :: CxtQ -> Name -> [TypeQ] -> Maybe Kind -> ConQ -> [DerivClauseQ] -> DecQ tySynInstD :: Name -> TySynEqnQ -> DecQ tySynEqn :: [TypeQ] -> TypeQ -> TySynEqnQ injectivityAnn :: Name -> [Name] -> InjectivityAnn noSig :: FamilyResultSig kindSig :: Kind -> FamilyResultSig tyVarSig :: TyVarBndr -> FamilyResultSig infixLD :: Int -> Name -> DecQ infixRD :: Int -> Name -> DecQ infixND :: Int -> Name -> DecQ cCall :: Callconv stdCall :: Callconv cApi :: Callconv prim :: Callconv javaScript :: Callconv unsafe :: Safety safe :: Safety interruptible :: Safety forImpD :: Callconv -> Safety -> String -> Name -> TypeQ -> DecQ funDep :: [Name] -> [Name] -> FunDep ruleVar :: Name -> RuleBndrQ typedRuleVar :: Name -> TypeQ -> RuleBndrQ valueAnnotation :: Name -> AnnTarget typeAnnotation :: Name -> AnnTarget moduleAnnotation :: AnnTarget pragInlD :: Name -> Inline -> RuleMatch -> Phases -> DecQ pragSpecD :: Name -> TypeQ -> Phases -> DecQ pragSpecInlD :: Name -> TypeQ -> Inline -> Phases -> DecQ pragSpecInstD :: TypeQ -> DecQ pragRuleD :: String -> [RuleBndrQ] -> ExpQ -> ExpQ -> Phases -> DecQ pragAnnD :: AnnTarget -> ExpQ -> DecQ pragLineD :: Int -> String -> DecQ pragCompleteD :: [Name] -> Maybe Name -> DecQ -- | Pattern synonym declaration patSynD :: Name -> PatSynArgsQ -> PatSynDirQ -> PatQ -> DecQ -- | Pattern synonym type signature patSynSigD :: Name -> TypeQ -> DecQ unidir :: PatSynDirQ implBidir :: PatSynDirQ explBidir :: [ClauseQ] -> PatSynDirQ prefixPatSyn :: [Name] -> PatSynArgsQ infixPatSyn :: Name -> Name -> PatSynArgsQ recordPatSyn :: [Name] -> PatSynArgsQ -- | Return the Module at the place of splicing. Can be used as an input -- for reifyModule. thisModule :: Q Module -- | The public face of Template Haskell -- -- For other documentation, refer to: -- http://www.haskell.org/haskellwiki/Template_Haskell module Language.Haskell.TH data Q a runQ :: Quasi m => Q a -> m a -- | Report an error to the user, but allow the current splice's -- computation to carry on. To abort the computation, use fail. reportError :: String -> Q () -- | Report a warning to the user, and carry on. reportWarning :: String -> Q () -- | Report an error (True) or warning (False), but carry on; use -- fail to stop. -- | Deprecated: Use reportError or reportWarning instead report :: Bool -> String -> Q () -- | Recover from errors raised by reportError or fail. recover :: Q a -> Q a -> Q a -- | The location at which this computation is spliced. location :: Q Loc data Loc Loc :: String -> String -> String -> CharPos -> CharPos -> Loc [loc_filename] :: Loc -> String [loc_package] :: Loc -> String [loc_module] :: Loc -> String [loc_start] :: Loc -> CharPos [loc_end] :: Loc -> CharPos -- | The runIO function lets you run an I/O computation in the -- Q monad. Take care: you are guaranteed the ordering of calls to -- runIO within a single Q computation, but not about the -- order in which splices are run. -- -- Note: for various murky reasons, stdout and stderr handles are not -- necessarily flushed when the compiler finishes running, so you should -- flush them yourself. runIO :: IO a -> Q a -- | reify looks up information about the Name. -- -- It is sometimes useful to construct the argument name using -- lookupTypeName or lookupValueName to ensure that we are -- reifying from the right namespace. For instance, in this context: -- --
--   data D = D
--   
-- -- which D does reify (mkName "D") return information -- about? (Answer: D-the-type, but don't rely on it.) To ensure -- we get information about D-the-value, use -- lookupValueName: -- --
--   do
--     Just nm <- lookupValueName "D"
--     reify nm
--   
-- -- and to get information about D-the-type, use -- lookupTypeName. reify :: Name -> Q Info -- | reifyModule mod looks up information about module -- mod. To look up the current module, call this function with -- the return value of thisModule. reifyModule :: Module -> Q ModuleInfo -- | Obtained from reify in the Q Monad. data Info -- | A class, with a list of its visible instances ClassI :: Dec -> [InstanceDec] -> Info -- | A class method ClassOpI :: Name -> Type -> ParentName -> Info -- | A "plain" type constructor. "Fancier" type constructors are returned -- using PrimTyConI or FamilyI as appropriate TyConI :: Dec -> Info -- | A type or data family, with a list of its visible instances. A closed -- type family is returned with 0 instances. FamilyI :: Dec -> [InstanceDec] -> Info -- | A "primitive" type constructor, which can't be expressed with a -- Dec. Examples: (->), Int#. PrimTyConI :: Name -> Arity -> Unlifted -> Info -- | A data constructor DataConI :: Name -> Type -> ParentName -> Info -- | A pattern synonym. PatSynI :: Name -> PatSynType -> Info -- | A "value" variable (as opposed to a type variable, see TyVarI). -- -- The Maybe Dec field contains Just the declaration -- which defined the variable -- including the RHS of the declaration -- -- or else Nothing, in the case where the RHS is unavailable to -- the compiler. At present, this value is _always_ Nothing: -- returning the RHS has not yet been implemented because of lack of -- interest. VarI :: Name -> Type -> Maybe Dec -> Info -- | A type variable. -- -- The Type field contains the type which underlies the -- variable. At present, this is always VarT theName, but -- future changes may permit refinement of this. TyVarI :: Name -> Type -> Info -- | Obtained from reifyModule in the Q Monad. data ModuleInfo -- | Contains the import list of the module. ModuleInfo :: [Module] -> ModuleInfo -- | InstanceDec desribes a single instance of a class or type -- function. It is just a Dec, but guaranteed to be one of the -- following: -- -- type InstanceDec = Dec -- | In ClassOpI and DataConI, name of the parent class or -- type type ParentName = Name -- | In UnboxedSumE and UnboxedSumP, the number associated -- with a particular data constructor. SumAlts are one-indexed and -- should never exceed the value of its corresponding SumArity. -- For example: -- -- type SumAlt = Int -- | In UnboxedSumE, UnboxedSumT, and UnboxedSumP, the -- total number of SumAlts. For example, (#|#) has a -- SumArity of 2. type SumArity = Int -- | In PrimTyConI, arity of the type constructor type Arity = Int -- | In PrimTyConI, is the type constructor unlifted? type Unlifted = Bool -- | The language extensions known to GHC. -- -- Note that there is an orphan Binary instance for this type -- supplied by the GHC.LanguageExtensions module provided by -- ghc-boot. We can't provide here as this would require adding -- transitive dependencies to the template-haskell package, -- which must have a minimal dependency set. data Extension Cpp :: Extension OverlappingInstances :: Extension UndecidableInstances :: Extension IncoherentInstances :: Extension UndecidableSuperClasses :: Extension MonomorphismRestriction :: Extension MonoPatBinds :: Extension MonoLocalBinds :: Extension RelaxedPolyRec :: Extension ExtendedDefaultRules :: Extension ForeignFunctionInterface :: Extension UnliftedFFITypes :: Extension InterruptibleFFI :: Extension CApiFFI :: Extension GHCForeignImportPrim :: Extension JavaScriptFFI :: Extension ParallelArrays :: Extension Arrows :: Extension TemplateHaskell :: Extension TemplateHaskellQuotes :: Extension QuasiQuotes :: Extension ImplicitParams :: Extension ImplicitPrelude :: Extension ScopedTypeVariables :: Extension AllowAmbiguousTypes :: Extension UnboxedTuples :: Extension UnboxedSums :: Extension BangPatterns :: Extension TypeFamilies :: Extension TypeFamilyDependencies :: Extension TypeInType :: Extension OverloadedStrings :: Extension OverloadedLists :: Extension NumDecimals :: Extension DisambiguateRecordFields :: Extension RecordWildCards :: Extension RecordPuns :: Extension ViewPatterns :: Extension GADTs :: Extension GADTSyntax :: Extension NPlusKPatterns :: Extension DoAndIfThenElse :: Extension BlockArguments :: Extension RebindableSyntax :: Extension ConstraintKinds :: Extension PolyKinds :: Extension DataKinds :: Extension InstanceSigs :: Extension ApplicativeDo :: Extension StandaloneDeriving :: Extension DeriveDataTypeable :: Extension AutoDeriveTypeable :: Extension DeriveFunctor :: Extension DeriveTraversable :: Extension DeriveFoldable :: Extension DeriveGeneric :: Extension DefaultSignatures :: Extension DeriveAnyClass :: Extension DeriveLift :: Extension DerivingStrategies :: Extension DerivingVia :: Extension TypeSynonymInstances :: Extension FlexibleContexts :: Extension FlexibleInstances :: Extension ConstrainedClassMethods :: Extension MultiParamTypeClasses :: Extension NullaryTypeClasses :: Extension FunctionalDependencies :: Extension UnicodeSyntax :: Extension ExistentialQuantification :: Extension MagicHash :: Extension EmptyDataDecls :: Extension KindSignatures :: Extension RoleAnnotations :: Extension ParallelListComp :: Extension TransformListComp :: Extension MonadComprehensions :: Extension GeneralizedNewtypeDeriving :: Extension RecursiveDo :: Extension PostfixOperators :: Extension TupleSections :: Extension PatternGuards :: Extension LiberalTypeSynonyms :: Extension RankNTypes :: Extension ImpredicativeTypes :: Extension TypeOperators :: Extension ExplicitNamespaces :: Extension PackageImports :: Extension ExplicitForAll :: Extension AlternativeLayoutRule :: Extension AlternativeLayoutRuleTransitional :: Extension DatatypeContexts :: Extension NondecreasingIndentation :: Extension RelaxedLayout :: Extension TraditionalRecordSyntax :: Extension LambdaCase :: Extension MultiWayIf :: Extension BinaryLiterals :: Extension NegativeLiterals :: Extension HexFloatLiterals :: Extension DuplicateRecordFields :: Extension OverloadedLabels :: Extension EmptyCase :: Extension PatternSynonyms :: Extension PartialTypeSignatures :: Extension NamedWildCards :: Extension StaticPointers :: Extension TypeApplications :: Extension Strict :: Extension StrictData :: Extension MonadFailDesugaring :: Extension EmptyDataDeriving :: Extension NumericUnderscores :: Extension QuantifiedConstraints :: Extension StarIsType :: Extension -- | List all enabled language extensions. extsEnabled :: Q [Extension] -- | Determine whether the given language extension is enabled in the -- Q monad. isExtEnabled :: Extension -> Q Bool -- | Look up the given name in the (type namespace of the) current splice's -- scope. See Language.Haskell.TH.Syntax#namelookup for more -- details. lookupTypeName :: String -> Q (Maybe Name) -- | Look up the given name in the (value namespace of the) current -- splice's scope. See Language.Haskell.TH.Syntax#namelookup for -- more details. lookupValueName :: String -> Q (Maybe Name) -- | reifyFixity nm attempts to find a fixity declaration for -- nm. For example, if the function foo has the fixity -- declaration infixr 7 foo, then reifyFixity 'foo -- would return Just (Fixity 7 InfixR). If -- the function bar does not have a fixity declaration, then -- reifyFixity 'bar returns Nothing, so you may assume -- bar has defaultFixity. reifyFixity :: Name -> Q (Maybe Fixity) -- | reifyInstances nm tys returns a list of visible instances of -- nm tys. That is, if nm is the name of a type class, -- then all instances of this class at the types tys are -- returned. Alternatively, if nm is the name of a data family -- or type family, all instances of this family at the types tys -- are returned. reifyInstances :: Name -> [Type] -> Q [InstanceDec] -- | Is the list of instances returned by reifyInstances nonempty? isInstance :: Name -> [Type] -> Q Bool -- | reifyRoles nm returns the list of roles associated with the -- parameters of the tycon nm. Fails if nm cannot be -- found or is not a tycon. The returned list should never contain -- InferR. reifyRoles :: Name -> Q [Role] -- | reifyAnnotations target returns the list of annotations -- associated with target. Only the annotations that are -- appropriately typed is returned. So if you have Int and -- String annotations for the same target, you have to call this -- function twice. reifyAnnotations :: Data a => AnnLookup -> Q [a] -- | Annotation target for reifyAnnotations data AnnLookup AnnLookupModule :: Module -> AnnLookup AnnLookupName :: Name -> AnnLookup -- | reifyConStrictness nm looks up the strictness information for -- the fields of the constructor with the name nm. Note that the -- strictness information that reifyConStrictness returns may not -- correspond to what is written in the source code. For example, in the -- following data declaration: -- --
--   data Pair a = Pair a a
--   
-- -- reifyConStrictness would return [DecidedLazy, -- DecidedLazy] under most circumstances, but it would return -- [DecidedStrict, DecidedStrict] if the -- -XStrictData language extension was enabled. reifyConStrictness :: Name -> Q [DecidedStrictness] data TExp a unType :: TExp a -> Exp -- | An abstract type representing names in the syntax tree. -- -- Names can be constructed in several ways, which come with -- different name-capture guarantees (see -- Language.Haskell.TH.Syntax#namecapture for an explanation of -- name capture): -- -- -- -- Names constructed using newName and mkName may be -- used in bindings (such as let x = ... or x -> -- ...), but names constructed using lookupValueName, -- lookupTypeName, 'f, ''T may not. data Name data NameSpace -- | Generate a capturable name. Occurrences of such names will be resolved -- according to the Haskell scoping rules at the occurrence site. -- -- For example: -- --
--   f = [| pi + $(varE (mkName "pi")) |]
--   ...
--   g = let pi = 3 in $f
--   
-- -- In this case, g is desugared to -- --
--   g = Prelude.pi + 3
--   
-- -- Note that mkName may be used with qualified names: -- --
--   mkName "Prelude.pi"
--   
-- -- See also dyn for a useful combinator. The above example could -- be rewritten using dyn as -- --
--   f = [| pi + $(dyn "pi") |]
--   
mkName :: String -> Name -- | Generate a fresh name, which cannot be captured. -- -- For example, this: -- --
--   f = $(do
--     nm1 <- newName "x"
--     let nm2 = mkName "x"
--     return (LamE [VarP nm1] (LamE [VarP nm2] (VarE nm1)))
--    )
--   
-- -- will produce the splice -- --
--   f = \x0 -> \x -> x0
--   
-- -- In particular, the occurrence VarE nm1 refers to the binding -- VarP nm1, and is not captured by the binding VarP -- nm2. -- -- Although names generated by newName cannot be -- captured, they can capture other names. For example, this: -- --
--   g = $(do
--     nm1 <- newName "x"
--     let nm2 = mkName "x"
--     return (LamE [VarP nm2] (LamE [VarP nm1] (VarE nm2)))
--    )
--   
-- -- will produce the splice -- --
--   g = \x -> \x0 -> x0
--   
-- -- since the occurrence VarE nm2 is captured by the innermost -- binding of x, namely VarP nm1. newName :: String -> Q Name -- | The name without its module prefix. -- --

Examples

-- --
--   >>> nameBase ''Data.Either.Either
--   "Either"
--   
--   >>> nameBase (mkName "foo")
--   "foo"
--   
--   >>> nameBase (mkName "Module.foo")
--   "foo"
--   
nameBase :: Name -> String -- | Module prefix of a name, if it exists. -- --

Examples

-- --
--   >>> nameModule ''Data.Either.Either
--   Just "Data.Either"
--   
--   >>> nameModule (mkName "foo")
--   Nothing
--   
--   >>> nameModule (mkName "Module.foo")
--   Just "Module"
--   
nameModule :: Name -> Maybe String -- | A name's package, if it exists. -- --

Examples

-- --
--   >>> namePackage ''Data.Either.Either
--   Just "base"
--   
--   >>> namePackage (mkName "foo")
--   Nothing
--   
--   >>> namePackage (mkName "Module.foo")
--   Nothing
--   
namePackage :: Name -> Maybe String -- | Returns whether a name represents an occurrence of a top-level -- variable (VarName), data constructor (DataName), type -- constructor, or type class (TcClsName). If we can't be sure, it -- returns Nothing. -- --

Examples

-- --
--   >>> nameSpace 'Prelude.id
--   Just VarName
--   
--   >>> nameSpace (mkName "id")
--   Nothing -- only works for top-level variable names
--   
--   >>> nameSpace 'Data.Maybe.Just
--   Just DataName
--   
--   >>> nameSpace ''Data.Maybe.Maybe
--   Just TcClsName
--   
--   >>> nameSpace ''Data.Ord.Ord
--   Just TcClsName
--   
nameSpace :: Name -> Maybe NameSpace -- | Tuple type constructor tupleTypeName :: Int -> Name -- | Tuple data constructor tupleDataName :: Int -> Name -- | Unboxed tuple type constructor unboxedTupleTypeName :: Int -> Name -- | Unboxed tuple data constructor unboxedTupleDataName :: Int -> Name -- | Unboxed sum type constructor unboxedSumTypeName :: SumArity -> Name -- | Unboxed sum data constructor unboxedSumDataName :: SumAlt -> SumArity -> Name data Dec -- |
--   { f p1 p2 = b where decs }
--   
FunD :: Name -> [Clause] -> Dec -- |
--   { p = b where decs }
--   
ValD :: Pat -> Body -> [Dec] -> Dec -- |
--   { data Cxt x => T x = A x | B (T x)
--          deriving (Z,W)
--          deriving stock Eq }
--   
DataD :: Cxt -> Name -> [TyVarBndr] -> Maybe Kind -> [Con] -> [DerivClause] -> Dec -- |
--   { newtype Cxt x => T x = A (B x)
--          deriving (Z,W Q)
--          deriving stock Eq }
--   
NewtypeD :: Cxt -> Name -> [TyVarBndr] -> Maybe Kind -> Con -> [DerivClause] -> Dec -- |
--   { type T x = (x,x) }
--   
TySynD :: Name -> [TyVarBndr] -> Type -> Dec -- |
--   { class Eq a => Ord a where ds }
--   
ClassD :: Cxt -> Name -> [TyVarBndr] -> [FunDep] -> [Dec] -> Dec -- |
--   { instance {-# OVERLAPS #-}
--           Show w => Show [w] where ds }
--   
InstanceD :: Maybe Overlap -> Cxt -> Type -> [Dec] -> Dec -- |
--   { length :: [a] -> Int }
--   
SigD :: Name -> Type -> Dec -- |
--   { foreign import ... }
--   { foreign export ... }
--   
ForeignD :: Foreign -> Dec -- |
--   { infix 3 foo }
--   
InfixD :: Fixity -> Name -> Dec -- |
--   { {-# INLINE [1] foo #-} }
--   
PragmaD :: Pragma -> Dec -- |
--   { data family T a b c :: * }
--   
DataFamilyD :: Name -> [TyVarBndr] -> Maybe Kind -> Dec -- |
--   { data instance Cxt x => T [x]
--          = A x | B (T x)
--          deriving (Z,W)
--          deriving stock Eq }
--   
DataInstD :: Cxt -> Name -> [Type] -> Maybe Kind -> [Con] -> [DerivClause] -> Dec -- |
--   { newtype instance Cxt x => T [x]
--           = A (B x)
--           deriving (Z,W)
--           deriving stock Eq }
--   
NewtypeInstD :: Cxt -> Name -> [Type] -> Maybe Kind -> Con -> [DerivClause] -> Dec -- |
--   { type instance ... }
--   
TySynInstD :: Name -> TySynEqn -> Dec -- |
--   { type family T a b c = (r :: *) | r -> a b }
--   
OpenTypeFamilyD :: TypeFamilyHead -> Dec -- |
--   { type family F a b = (r :: *) | r -> a where ... }
--   
ClosedTypeFamilyD :: TypeFamilyHead -> [TySynEqn] -> Dec -- |
--   { type role T nominal representational }
--   
RoleAnnotD :: Name -> [Role] -> Dec -- |
--   { deriving stock instance Ord a => Ord (Foo a) }
--   
StandaloneDerivD :: Maybe DerivStrategy -> Cxt -> Type -> Dec -- |
--   { default size :: Data a => a -> Int }
--   
DefaultSigD :: Name -> Type -> Dec -- | { pattern P v1 v2 .. vn <- p } unidirectional or { -- pattern P v1 v2 .. vn = p } implicit bidirectional or { -- pattern P v1 v2 .. vn <- p where P v1 v2 .. vn = e } explicit -- bidirectional -- -- also, besides prefix pattern synonyms, both infix and record pattern -- synonyms are supported. See PatSynArgs for details PatSynD :: Name -> PatSynArgs -> PatSynDir -> Pat -> Dec -- | A pattern synonym's type signature. PatSynSigD :: Name -> PatSynType -> Dec -- | A single data constructor. -- -- The constructors for Con can roughly be divided up into two -- categories: those for constructors with "vanilla" syntax -- (NormalC, RecC, and InfixC), and those for -- constructors with GADT syntax (GadtC and RecGadtC). The -- ForallC constructor, which quantifies additional type variables -- and class contexts, can surround either variety of constructor. -- However, the type variables that it quantifies are different depending -- on what constructor syntax is used: -- -- -- --
--   data Foo a = forall b. MkFoo a b
--   
--   
-- -- In MkFoo, ForallC will quantify b, but not -- a. -- -- -- --
--   data Bar a b where
--     MkBar :: (a ~ b) => c -> MkBar a b
--   
--   
-- -- In MkBar, ForallC will quantify a, -- b, and c. data Con -- |
--   C Int a
--   
NormalC :: Name -> [BangType] -> Con -- |
--   C { v :: Int, w :: a }
--   
RecC :: Name -> [VarBangType] -> Con -- |
--   Int :+ a
--   
InfixC :: BangType -> Name -> BangType -> Con -- |
--   forall a. Eq a => C [a]
--   
ForallC :: [TyVarBndr] -> Cxt -> Con -> Con -- |
--   C :: a -> b -> T b Int
--   
GadtC :: [Name] -> [BangType] -> Type -> Con -- |
--   C :: { v :: Int } -> T b Int
--   
RecGadtC :: [Name] -> [VarBangType] -> Type -> Con data Clause -- |
--   f { p1 p2 = body where decs }
--   
Clause :: [Pat] -> Body -> [Dec] -> Clause data SourceUnpackedness -- |
--   C a
--   
NoSourceUnpackedness :: SourceUnpackedness -- |
--   C { {-# NOUNPACK #-} } a
--   
SourceNoUnpack :: SourceUnpackedness -- |
--   C { {-# UNPACK #-} } a
--   
SourceUnpack :: SourceUnpackedness data SourceStrictness -- |
--   C a
--   
NoSourceStrictness :: SourceStrictness -- |
--   C {~}a
--   
SourceLazy :: SourceStrictness -- |
--   C {!}a
--   
SourceStrict :: SourceStrictness -- | Unlike SourceStrictness and SourceUnpackedness, -- DecidedStrictness refers to the strictness that the compiler -- chooses for a data constructor field, which may be different from what -- is written in source code. See reifyConStrictness for more -- information. data DecidedStrictness DecidedLazy :: DecidedStrictness DecidedStrict :: DecidedStrictness DecidedUnpack :: DecidedStrictness data Bang -- |
--   C { {-# UNPACK #-} !}a
--   
Bang :: SourceUnpackedness -> SourceStrictness -> Bang -- | As of template-haskell-2.11.0.0, Strict has been -- replaced by Bang. type Strict = Bang data Foreign ImportF :: Callconv -> Safety -> String -> Name -> Type -> Foreign ExportF :: Callconv -> String -> Name -> Type -> Foreign data Callconv CCall :: Callconv StdCall :: Callconv CApi :: Callconv Prim :: Callconv JavaScript :: Callconv data Safety Unsafe :: Safety Safe :: Safety Interruptible :: Safety data Pragma InlineP :: Name -> Inline -> RuleMatch -> Phases -> Pragma SpecialiseP :: Name -> Type -> Maybe Inline -> Phases -> Pragma SpecialiseInstP :: Type -> Pragma RuleP :: String -> [RuleBndr] -> Exp -> Exp -> Phases -> Pragma AnnP :: AnnTarget -> Exp -> Pragma LineP :: Int -> String -> Pragma -- |
--   { {-# COMPLETE C_1, ..., C_i [ :: T ] #-} }
--   
CompleteP :: [Name] -> Maybe Name -> Pragma data Inline NoInline :: Inline Inline :: Inline Inlinable :: Inline data RuleMatch ConLike :: RuleMatch FunLike :: RuleMatch data Phases AllPhases :: Phases FromPhase :: Int -> Phases BeforePhase :: Int -> Phases data RuleBndr RuleVar :: Name -> RuleBndr TypedRuleVar :: Name -> Type -> RuleBndr data AnnTarget ModuleAnnotation :: AnnTarget TypeAnnotation :: Name -> AnnTarget ValueAnnotation :: Name -> AnnTarget data FunDep FunDep :: [Name] -> [Name] -> FunDep -- | One equation of a type family instance or closed type family. The -- arguments are the left-hand-side type patterns and the right-hand-side -- result. data TySynEqn TySynEqn :: [Type] -> Type -> TySynEqn -- | Common elements of OpenTypeFamilyD and -- ClosedTypeFamilyD. By analogy with "head" for type classes and -- type class instances as defined in Type classes: an exploration of -- the design space, the TypeFamilyHead is defined to be the -- elements of the declaration between type family and -- where. data TypeFamilyHead TypeFamilyHead :: Name -> [TyVarBndr] -> FamilyResultSig -> Maybe InjectivityAnn -> TypeFamilyHead data Fixity Fixity :: Int -> FixityDirection -> Fixity data FixityDirection InfixL :: FixityDirection InfixR :: FixityDirection InfixN :: FixityDirection -- | Default fixity: infixl 9 defaultFixity :: Fixity -- | Highest allowed operator precedence for Fixity constructor -- (answer: 9) maxPrecedence :: Int -- | A pattern synonym's directionality. data PatSynDir -- |
--   pattern P x {<-} p
--   
Unidir :: PatSynDir -- |
--   pattern P x {=} p
--   
ImplBidir :: PatSynDir -- |
--   pattern P x {<-} p where P x = e
--   
ExplBidir :: [Clause] -> PatSynDir -- | A pattern synonym's argument type. data PatSynArgs -- |
--   pattern P {x y z} = p
--   
PrefixPatSyn :: [Name] -> PatSynArgs -- |
--   pattern {x P y} = p
--   
InfixPatSyn :: Name -> Name -> PatSynArgs -- |
--   pattern P { {x,y,z} } = p
--   
RecordPatSyn :: [Name] -> PatSynArgs data Exp -- |
--   { x }
--   
VarE :: Name -> Exp -- |
--   data T1 = C1 t1 t2; p = {C1} e1 e2
--   
ConE :: Name -> Exp -- |
--   { 5 or 'c'}
--   
LitE :: Lit -> Exp -- |
--   { f x }
--   
AppE :: Exp -> Exp -> Exp -- |
--   { f @Int }
--   
AppTypeE :: Exp -> Type -> Exp -- |
--   {x + y} or {(x+)} or {(+ x)} or {(+)}
--   
InfixE :: Maybe Exp -> Exp -> Maybe Exp -> Exp -- |
--   {x + y}
--   
-- -- See Language.Haskell.TH.Syntax#infix UInfixE :: Exp -> Exp -> Exp -> Exp -- |
--   { (e) }
--   
-- -- See Language.Haskell.TH.Syntax#infix ParensE :: Exp -> Exp -- |
--   { \ p1 p2 -> e }
--   
LamE :: [Pat] -> Exp -> Exp -- |
--   { \case m1; m2 }
--   
LamCaseE :: [Match] -> Exp -- |
--   { (e1,e2) }
--   
TupE :: [Exp] -> Exp -- |
--   { (# e1,e2 #) }
--   
UnboxedTupE :: [Exp] -> Exp -- |
--   { (#|e|#) }
--   
UnboxedSumE :: Exp -> SumAlt -> SumArity -> Exp -- |
--   { if e1 then e2 else e3 }
--   
CondE :: Exp -> Exp -> Exp -> Exp -- |
--   { if | g1 -> e1 | g2 -> e2 }
--   
MultiIfE :: [(Guard, Exp)] -> Exp -- |
--   { let x=e1;   y=e2 in e3 }
--   
LetE :: [Dec] -> Exp -> Exp -- |
--   { case e of m1; m2 }
--   
CaseE :: Exp -> [Match] -> Exp -- |
--   { do { p <- e1; e2 }  }
--   
DoE :: [Stmt] -> Exp -- |
--   { [ (x,y) | x <- xs, y <- ys ] }
--   
-- -- The result expression of the comprehension is the last of the -- Stmts, and should be a NoBindS. -- -- E.g. translation: -- --
--   [ f x | x <- xs ]
--   
-- --
--   CompE [BindS (VarP x) (VarE xs), NoBindS (AppE (VarE f) (VarE x))]
--   
CompE :: [Stmt] -> Exp -- |
--   { [ 1 ,2 .. 10 ] }
--   
ArithSeqE :: Range -> Exp -- |
--   { [1,2,3] }
--   
ListE :: [Exp] -> Exp -- |
--   { e :: t }
--   
SigE :: Exp -> Type -> Exp -- |
--   { T { x = y, z = w } }
--   
RecConE :: Name -> [FieldExp] -> Exp -- |
--   { (f x) { z = w } }
--   
RecUpdE :: Exp -> [FieldExp] -> Exp -- |
--   { static e }
--   
StaticE :: Exp -> Exp -- | { _x } (hole) UnboundVarE :: Name -> Exp -- | { #x } ( Overloaded label ) LabelE :: String -> Exp data Match -- |
--   case e of { pat -> body where decs }
--   
Match :: Pat -> Body -> [Dec] -> Match data Body -- |
--   f p { | e1 = e2
--         | e3 = e4 }
--    where ds
--   
GuardedB :: [(Guard, Exp)] -> Body -- |
--   f p { = e } where ds
--   
NormalB :: Exp -> Body data Guard -- |
--   f x { | odd x } = x
--   
NormalG :: Exp -> Guard -- |
--   f x { | Just y <- x, Just z <- y } = z
--   
PatG :: [Stmt] -> Guard data Stmt BindS :: Pat -> Exp -> Stmt LetS :: [Dec] -> Stmt NoBindS :: Exp -> Stmt ParS :: [[Stmt]] -> Stmt data Range FromR :: Exp -> Range FromThenR :: Exp -> Exp -> Range FromToR :: Exp -> Exp -> Range FromThenToR :: Exp -> Exp -> Exp -> Range data Lit CharL :: Char -> Lit StringL :: String -> Lit -- | Used for overloaded and non-overloaded literals. We don't have a good -- way to represent non-overloaded literals at the moment. Maybe that -- doesn't matter? IntegerL :: Integer -> Lit RationalL :: Rational -> Lit IntPrimL :: Integer -> Lit WordPrimL :: Integer -> Lit FloatPrimL :: Rational -> Lit DoublePrimL :: Rational -> Lit -- | A primitive C-style string, type Addr# StringPrimL :: [Word8] -> Lit CharPrimL :: Char -> Lit -- | Pattern in Haskell given in {} data Pat -- |
--   { 5 or 'c' }
--   
LitP :: Lit -> Pat -- |
--   { x }
--   
VarP :: Name -> Pat -- |
--   { (p1,p2) }
--   
TupP :: [Pat] -> Pat -- |
--   { (# p1,p2 #) }
--   
UnboxedTupP :: [Pat] -> Pat -- |
--   { (#|p|#) }
--   
UnboxedSumP :: Pat -> SumAlt -> SumArity -> Pat -- |
--   data T1 = C1 t1 t2; {C1 p1 p1} = e
--   
ConP :: Name -> [Pat] -> Pat -- |
--   foo ({x :+ y}) = e
--   
InfixP :: Pat -> Name -> Pat -> Pat -- |
--   foo ({x :+ y}) = e
--   
-- -- See Language.Haskell.TH.Syntax#infix UInfixP :: Pat -> Name -> Pat -> Pat -- |
--   {(p)}
--   
-- -- See Language.Haskell.TH.Syntax#infix ParensP :: Pat -> Pat -- |
--   { ~p }
--   
TildeP :: Pat -> Pat -- |
--   { !p }
--   
BangP :: Pat -> Pat -- |
--   { x @ p }
--   
AsP :: Name -> Pat -> Pat -- |
--   { _ }
--   
WildP :: Pat -- |
--   f (Pt { pointx = x }) = g x
--   
RecP :: Name -> [FieldPat] -> Pat -- |
--   { [1,2,3] }
--   
ListP :: [Pat] -> Pat -- |
--   { p :: t }
--   
SigP :: Pat -> Type -> Pat -- |
--   { e -> p }
--   
ViewP :: Exp -> Pat -> Pat type FieldExp = (Name, Exp) type FieldPat = (Name, Pat) data Type -- |
--   forall <vars>. <ctxt> => <type>
--   
ForallT :: [TyVarBndr] -> Cxt -> Type -> Type -- |
--   T a b
--   
AppT :: Type -> Type -> Type -- |
--   t :: k
--   
SigT :: Type -> Kind -> Type -- |
--   a
--   
VarT :: Name -> Type -- |
--   T
--   
ConT :: Name -> Type -- |
--   'T
--   
PromotedT :: Name -> Type -- |
--   T + T
--   
InfixT :: Type -> Name -> Type -> Type -- |
--   T + T
--   
-- -- See Language.Haskell.TH.Syntax#infix UInfixT :: Type -> Name -> Type -> Type -- |
--   (T)
--   
ParensT :: Type -> Type -- |
--   (,), (,,), etc.
--   
TupleT :: Int -> Type -- |
--   (#,#), (#,,#), etc.
--   
UnboxedTupleT :: Int -> Type -- |
--   (#|#), (#||#), etc.
--   
UnboxedSumT :: SumArity -> Type -- |
--   ->
--   
ArrowT :: Type -- |
--   ~
--   
EqualityT :: Type -- |
--   []
--   
ListT :: Type -- |
--   '(), '(,), '(,,), etc.
--   
PromotedTupleT :: Int -> Type -- |
--   '[]
--   
PromotedNilT :: Type -- |
--   (':)
--   
PromotedConsT :: Type -- |
--   *
--   
StarT :: Type -- |
--   Constraint
--   
ConstraintT :: Type -- |
--   0,1,2, etc.
--   
LitT :: TyLit -> Type -- |
--   _
--   
WildCardT :: Type data TyVarBndr -- |
--   a
--   
PlainTV :: Name -> TyVarBndr -- |
--   (a :: k)
--   
KindedTV :: Name -> Kind -> TyVarBndr data TyLit -- |
--   2
--   
NumTyLit :: Integer -> TyLit -- |
--   "Hello"
--   
StrTyLit :: String -> TyLit -- | To avoid duplication between kinds and types, they are defined to be -- the same. Naturally, you would never have a type be StarT and -- you would never have a kind be SigT, but many of the other -- constructors are shared. Note that the kind Bool is denoted -- with ConT, not PromotedT. Similarly, tuple kinds are -- made with TupleT, not PromotedTupleT. type Kind = Type type Cxt = [Pred] " @(Eq a, Ord b)@" -- | Since the advent of ConstraintKinds, constraints are really -- just types. Equality constraints use the EqualityT constructor. -- Constraints may also be tuples of other constraints. type Pred = Type -- | Role annotations data Role -- |
--   nominal
--   
NominalR :: Role -- |
--   representational
--   
RepresentationalR :: Role -- |
--   phantom
--   
PhantomR :: Role -- |
--   _
--   
InferR :: Role -- | Type family result signature data FamilyResultSig -- | no signature NoSig :: FamilyResultSig -- |
--   k
--   
KindSig :: Kind -> FamilyResultSig -- |
--   = r, = (r :: k)
--   
TyVarSig :: TyVarBndr -> FamilyResultSig -- | Injectivity annotation data InjectivityAnn InjectivityAnn :: Name -> [Name] -> InjectivityAnn -- | A Pattern synonym's type. Note that a pattern synonym's *fully* -- specified type has a peculiar shape coming with two forall quantifiers -- and two constraint contexts. For example, consider the pattern synonym -- -- pattern P x1 x2 ... xn = some-pattern -- -- P's complete type is of the following form -- -- forall universals. required constraints => forall existentials. -- provided constraints => t1 -> t2 -> ... -> tn -> t -- -- consisting of four parts: -- -- 1) the (possibly empty lists of) universally quantified type variables -- and required constraints on them. 2) the (possibly empty lists of) -- existentially quantified type variables and the provided constraints -- on them. 3) the types t1, t2, .., tn of x1, x2, .., xn, respectively -- 4) the type t of some-pattern, mentioning only universals. -- -- Pattern synonym types interact with TH when (a) reifying a pattern -- synonym, (b) pretty printing, or (c) specifying a pattern synonym's -- type signature explicitly: -- -- (a) Reification always returns a pattern synonym's *fully* specified -- type in abstract syntax. -- -- (b) Pretty printing via pprPatSynType abbreviates a pattern -- synonym's type unambiguously in concrete syntax: The rule of thumb is -- to print initial empty universals and the required context as `() -- =>`, if existentials and a provided context follow. If only -- universals and their required context, but no existentials are -- specified, only the universals and their required context are printed. -- If both or none are specified, so both (or none) are printed. -- -- (c) When specifying a pattern synonym's type explicitly with -- PatSynSigD either one of the universals, the existentials, or -- their contexts may be left empty. -- -- See the GHC user's guide for more information on pattern synonyms and -- their types: -- https://downloads.haskell.org/~ghc/latest/docs/html/ -- users_guide/syntax-extns.html#pattern-synonyms. type PatSynType = Type class Ppr a ppr :: Ppr a => a -> Doc ppr_list :: Ppr a => [a] -> Doc pprint :: Ppr a => a -> String pprExp :: Precedence -> Exp -> Doc pprLit :: Precedence -> Lit -> Doc pprPat :: Precedence -> Pat -> Doc pprParendType :: Type -> Doc