Moduletemplate-haskell-2.22.0.0Haskell2010
Language.Haskell.TH.Lib
Language.Haskell.TH.Lib contains lots of useful helper functions for generating and manipulating Template Haskell terms
- 41 types
- 1 class
- 247 values
- Packagetemplate-haskell-2.22.0.0
- Exports289
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceLib.hs
Library functions
0 declarationsAbbreviations
Representation-polymorphic since template-haskell-2.17.0.0.
Constructors lifted to Q
Literals
mkBytes :: ForeignPtr Word8Pointer to the data
-> WordOffset from the pointer
-> WordNumber of bytes
-> Bytes
Create a Bytes datatype representing raw bytes to be embedded into the program/library binary.
Patterns
Pattern Guards
Use with caseE
Use with funD
Expressions
Dynamically binding a variable (unhygienic)
staticE x = [| static x |]Single-arg lambda
Lambda-case (case)
Lambda-cases (cases)
Ranges
Ranges with more indirection
Statements
Types
Type literals
Strictness
Deprecated. Use bang. See https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.0. Example usage: 'bang noSourceUnpackedness sourceStrict'
Deprecated. Use bang. See https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.0. Example usage: 'bang noSourceUnpackedness noSourceStrictness'
Deprecated. Use bang. See https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.0. Example usage: 'bang sourceUnpack sourceStrict'
Deprecated. As of template-haskell-2.11.0.0, StrictType has been replaced by BangType. Please use bangType instead.
Deprecated. As of template-haskell-2.11.0.0, VarStrictType has been replaced by VarBangType. Please use varBangType instead.
Class Contexts
Deprecated. As of template-haskell-2.10, constraint predicates (Pred) are just types (Type), in keeping with ConstraintKinds. Please see equalityT.
Constructors
Kinds
Type variable binders
Methods
defaultBndrFlag :: flag
Instances3DefaultBndrFlag
DefaultBndrFlag BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.LibDefaultBndrFlag SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.LibDefaultBndrFlag ()Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Lib
Roles
Top Level Declarations
Data
A single deriving clause at the end of a datatype.
Constructors
DerivClause (Maybe DerivStrategy) Cxt{ deriving stock (Eq, Ord) }
Instances6Eq, Data, Ord, Show, Generic, Rep
Eq DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntaxtype Rep DerivClause = D1 ('MetaDataDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax"DerivClause"
"Language.Haskell.TH.Syntax"
"template-haskell"
'False) (C1 ('MetaCons"DerivClause"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe DerivStrategy)) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Cxt)))
What the user explicitly requests when deriving an instance.
Constructors
StockStrategyA "standard" derived instance
AnyclassStrategy-XDeriveAnyClassNewtypeStrategy-XGeneralizedNewtypeDerivingViaStrategy Type-XDerivingVia
Instances6Eq, Data, Ord, Show, Generic, Rep
Eq DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntaxtype Rep DerivStrategy = D1 ('MetaDataDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax"DerivStrategy"
"Language.Haskell.TH.Syntax"
"template-haskell"
'False) ((C1 ('MetaCons"StockStrategy"
'PrefixI 'False) U1 :+: C1 ('MetaCons"AnyclassStrategy"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"NewtypeStrategy"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ViaStrategy"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type))))
Class
Varieties of allowed instance overlap.
Constructors
OverlappableMay be overlapped by more specific instances
OverlappingMay overlap a more general instance
OverlapsBoth Overlapping and Overlappable
IncoherentBoth Overlapping and Overlappable, and pick an arbitrary one if multiple choices are available.
Instances6Eq, Data, Ord, Show, Generic, Rep
Eq OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntaxtype Rep Overlap = D1 ('MetaDataDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax"Overlap"
"Language.Haskell.TH.Syntax"
"template-haskell"
'False) ((C1 ('MetaCons"Overlappable"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Overlapping"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"Overlaps"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Incoherent"
'PrefixI 'False) U1))
Role annotations
Type Family / Data Family
Fixity
Default declaration
Foreign Function Interface (FFI)
Functional dependencies
Pragmas
Pattern Synonyms
Pattern synonym declaration
Pattern synonym type signature
Implicit Parameters
Implicit parameter binding declaration. Can only be used in let and where clauses which consist entirely of implicit bindings.
Reify
pure the Module at the place of splicing. Can be used as an input for reifyModule.
Documentation
Attaches Haddock documentation to the declaration provided. Unlike putDoc, the names do not need to be in scope when calling this function so it can be used for quoted declarations and anything else currently being spliced. Not all declarations can have documentation attached to them. For those that can't, withDecDoc will return it unchanged without any side effects.
Variant of withDecDoc that applies the same documentation to multiple declarations. Useful for documenting quoted declarations.
funD_doc Variant of funD that attaches Haddock documentation.
dataD_doc Variant of dataD that attaches Haddock documentation.
newtypeD_doc Variant of newtypeD that attaches Haddock documentation.
typeDataD_doc Variant of typeDataD that attaches Haddock documentation.
dataInstD_doc Variant of dataInstD that attaches Haddock documentation.
newtypeInstD_doc Variant of newtypeInstD that attaches Haddock documentation.
patSynD_doc Variant of patSynD that attaches Haddock documentation.