Moduletemplate-haskell-2.24.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
- 252 values
- Packagetemplate-haskell-2.24.0.0
- Exports294
- 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.24.0.0 · Language.Haskell.TH.LibDefaultBndrFlag SpecificityDefined in template-haskell-2.24.0.0 · Language.Haskell.TH.LibDefaultBndrFlag ()Defined in template-haskell-2.24.0.0 · Language.Haskell.TH.Lib
Roles
Top Level Declarations
Data
A single deriving clause at the end of a datatype declaration.
Constructors
DerivClause (Maybe DerivStrategy) Cxt{ deriving stock (Eq, Ord) }
Instances7Eq, Data, Ord, Show, Generic, Lift, …
Eq DerivClauseDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxData DerivClauseDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxOrd DerivClauseDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxShow DerivClauseDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxGeneric DerivClauseDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxLift DerivClauseDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Lifttype Rep DerivClause = D1 ('MetaDataDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax"DerivClause"
"GHC.Internal.TH.Syntax"
"ghc-internal"
'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 with
-XDerivingStrategies.
Constructors
StockStrategyderiving {stock} CAnyclassStrategyderiving {anyclass} C,-XDeriveAnyClassNewtypeStrategyderiving {newtype} C,-XGeneralizedNewtypeDerivingViaStrategy Typederiving C {via T},-XDerivingVia
Instances7Eq, Data, Ord, Show, Generic, Lift, …
Eq DerivStrategyDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxData DerivStrategyDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxOrd DerivStrategyDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxShow DerivStrategyDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxGeneric DerivStrategyDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxLift DerivStrategyDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Lifttype Rep DerivStrategy = D1 ('MetaDataDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax"DerivStrategy"
"GHC.Internal.TH.Syntax"
"ghc-internal"
'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.
Instances7Eq, Data, Ord, Show, Generic, Lift, …
Eq OverlapDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxData OverlapDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxOrd OverlapDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxShow OverlapDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxGeneric OverlapDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxLift OverlapDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Lifttype Rep Overlap = D1 ('MetaDataDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax"Overlap"
"GHC.Internal.TH.Syntax"
"ghc-internal"
'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.