Support library for Template Haskell
|Version on this page:||188.8.131.52|
|LTS Haskell 20.16:||184.108.40.206|
|Stackage Nightly 2023-03-30:||220.127.116.11|
|Latest on Hackage:||18.104.22.168|
Module documentation for 22.214.171.124
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.
DefaultDconstructor to support Haskell
The types of
conPhave been changed to allow for an additional list of type applications preceding the argument patterns.
Add support for the
Charkind (#11342): we extend the
TyLitdata type with the constructor
CharTyLitthat reflects type-level characters.
getDocwhich allow Haddock documentation to be attached to module headers, declarations, function arguments and instances, as well as queried. These are quite low level operations, so for convenience there are several combinators that can be used with
Decs directly, including
withDecsDocas well as
_doccounterparts to many of the
newDeclarationGroupto document the effect of visibility while reifying types and instances.
Add support for Overloaded Record Dot. Introduces
getFieldE :: Quote m => m Exp -> String -> m Expand
projectionE :: Quote m => [String] -> m Exp.
Typed Quotations now return a value of type
Code m a(GHC Proposal #195). The main motiviation is to make writing instances easier and make it easier to store
Codevalues in type-indexed maps.
Implement Overloaded Quotations (GHC Proposal #246). This patch modifies a few fundamental things in the API. All the library combinators are generalised to be in terms of a new minimal class
Quote. The types of
liftDataare modified to return
m Exprather than
Q Exp. Instances written in terms of
Qare now disallowed. The types of
unTypeQare also generalised in terms of
Quoterather than specific to
Implement Explicit specificity in type variable binders (GHC Proposal #99). In
TyVarBndris now annotated with a
flag, denoting the additional argument to its constructors
flagis either the
Specificityof the type variable (
Fix Eq/Ord instances for
Bytes: we were comparing pointers while we should compare the actual bytes (#16457).
Fix Show instance for
Bytes: we were showing the pointer value while we want to show the contents (#16457).
Add support for QualifiedDo. The data constructors
MDoEgot a new
Maybe ModNameargument to describe the qualifier of do blocks.
The argument to
TExpQcan now be levity polymorphic.
126.96.36.199 Jan 2020
Bundled with GHC 8.10.1
Add support for tuple sections. (#15843) The type signatures of
UnboxedTupEhave changed from
[Exp] -> Expto
[Maybe Exp] -> Exp. The type signatures of
unboxedTupEremain the same for backwards compatibility.
liftTypedmethod to the
Liftclass and set the default implementations of
liftin terms of
Typeto represent visible, dependent quantification.
Introduce support for
Bytesliterals (raw bytes embedded into the output binary)
Lifttypeclass levity-polymorphic and add instances for unboxed tuples, unboxed sums,
reifyTypeto reify the type or kind of a thing referenced by
188.8.131.52 May 2019
Bundled with GHC 8.8.1
RulePnow all have a
Maybe [TyVarBndr]argument, which contains a list of quantified type variables if an explicit
forallis present, and
TySynEqnalso now use a single
Typeargument to represent the left-hand-side to avoid malformed type family equations and allow visible kind application.
tySynEqnnow all have a
Maybe [TyVarBndrQ]argument. Non-API-breaking versions of these functions can be found in
Language.Haskell.TH.Lib. The type signature of
tySynEqnhas also changed from
[TypeQ] -> TypeQ -> TySynEqnQto
(Maybe [TyVarBndrQ]) -> TypeQ -> TypeQ -> TySynEqnQ, for the same reason as in
tySynInstDalso changes from
Name -> TySynEqnQ -> DecQto
TySynEqnQ -> DecQ.
addForeignFilePathnow support assembler sources (#16180).
184.108.40.206 September 2018
Bundled with GHC 8.6.1
addForeignFilePathfunction, as well as a corresponding
qAddForeignFileclass method to
addForeignFile, which takes the contents of the file as an argument,
addForeignFilePathtakes as an argument a path pointing to a foreign file. A new
addForeignSourcefunction has also been added which takes a file’s contents as an argument.
addForeignFilefunction is now deprecated in favor of
addForeignSource, and the
Quasihas been removed entirely.
addTempFilefunction, as well as a corresponding
Quasi, which requests a temporary file of a given suffix.
Add support for
Add support for
220.127.116.11 March 2018
Bundled with GHC 8.4.1
Language.Haskell.TH.FamFlavour, which was deprecated in 2.11, has been removed.
Add support for overloaded labels. Introduces
labelE :: String -> ExpQ.
Language.Haskell.TH.Lib.Internalmodule, which 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.
MonadIOis now a superclass of
qRunIOhas a default implementation
qRunIO = liftIO
18.104.22.168 July 2017
Bundled with GHC 8.2.1
Add support for pattern synonyms. This introduces one new constructor to
PatSynI), two new constructors to
PatSynSigD), and two new data types (
PatSynArgs), among other changes. (#8761)
Add support for unboxed sums. (#12478)
Add support for visible type applications. (#12530)
Add support for attaching deriving strategies to
Add support for
unboxedTupleDataNamenow work for unboxed 0-tuples and 1-tuples (#12977)
Language.Haskell.THnow reexports all of
Language.Haskell.TH.Lib. (#12992). This causes
Language.Haskell.THto export more types and functions that it did before:
Add support for overloaded labels.
22.214.171.124 May 2016
Bundled with GHC 8.0.1
The compiler can now resolve infix operator fixities in types on its own. The
Typeis analoguous to
UInfixEfor expressions and can contain a tree of infix type applications which will be reassociated according to the fixities of the operators. The
ParensTconstructor can be used to explicitly group expressions.
dataToExpQable to handle
toConstrimplementation relies on a function instead of a data constructor (#10796)
OpenTypeFamilyDas the representation of data families and open type families respectively. (#6018)
TypeFamilyHeadfor common elements of
Strictdatatype was split among different datatypes: three for writing the strictness information of data constructors’ fields as denoted in Haskell source code (
SourceStrictness, as well as
Bang), and one for strictness information after a constructor is compiled (
VarStrictTypehave been deprecated in favor of
reifyConStrictnessto query a data constructor’s
DecidedStrictnessvalues for its fields (#10697)
VarIconstructors no longer have a
Fixityfield. Instead, all
Fixityinformation for a given
Nameis now determined through the
reifyFixityfunction, which returns
Justthe fixity if there is an explicit fixity declaration for that
Nothingotherwise (#10704 and #11345)
MonadFail Qinstance for GHC 8.0 and later (#11661)
Add support for OVERLAP(S/PED/PING) pragmas on instances
126.96.36.199 Mar 2015
- Bundled with GHC 7.10.1
- Remove build-dependency on
Preda type synonym of
Type, and deprecate
- Add support for
Genericfor TH types (#9527)
- Add support for generic default signatures via
- Derive new
- Make calling conventions available in template haskell consistent with those from GHC (#9703)
- Add support for
Ordinstances to TH types
- Merge some instances from
Locas well as
Liftinstances for numeric types
- Put parens around
(ty :: kind)when pretty-printing TH syntax