HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

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

Library functions

0 declarations

Abbreviations

typetype TExpQ (a :: TYPE r) = Q (TExp a)
#

Representation-polymorphic since template-haskell-2.17.0.0.

Constructors lifted to Q

Literals

valuemkBytes
  1. :: ForeignPtr Word8

    Pointer to the data

  2. -> Word

    Offset from the pointer

  3. -> Word

    Number of bytes

  4. -> Bytes
#

Create a Bytes datatype representing raw bytes to be embedded into the program/library binary.

Patterns

Pattern Guards

Expressions

Ranges

Ranges with more indirection

Statements

Types

Type literals

Strictness

Class Contexts

valueclassP :: Quote m => Name -> [m Type] -> m Pred
#

Deprecated. As of template-haskell-2.10, constraint predicates (Pred) are just types (Type), in keeping with ConstraintKinds. Please use conT and appT.

valueequalP :: Quote m => m Type -> m Type -> m Pred
#

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

Roles

Top Level Declarations

Data

datadata DerivClause
#

A single deriving clause at the end of a datatype.

Constructors

Instances6Eq, Data, Ord, Show, Generic, Rep
datadata DerivStrategy
#

What the user explicitly requests when deriving an instance.

Constructors

Instances6Eq, Data, Ord, Show, Generic, Rep

Class

datadata Overlap
#

Varieties of allowed instance overlap.

Constructors

Instances6Eq, Data, Ord, Show, Generic, Rep

Role annotations

Type Family / Data Family

Fixity

Default declaration

Foreign Function Interface (FFI)

Functional dependencies

Pragmas

Pattern Synonyms

Implicit Parameters

valueimplicitParamBindD :: Quote m => String -> m Exp -> m Dec
#

Implicit parameter binding declaration. Can only be used in let and where clauses which consist entirely of implicit bindings.

Reify

Documentation

valuewithDecDoc :: String -> Q Dec -> Q Dec
#

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.

valuewithDecsDoc :: String -> Q [Dec] -> Q [Dec]
#

Variant of withDecDoc that applies the same documentation to multiple declarations. Useful for documenting quoted declarations.