diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2019-11-27 15:29:44 +0000 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-01-12 05:25:30 -0500 |
commit | 4ef5871feccc58927428b4eabe46100b25821f15 (patch) | |
tree | 024ea80f47b361183ff9fb6fd8e5c9cc06452967 /libraries/template-haskell/Language/Haskell/TH.hs | |
parent | 99a9f51bf8207c79241fc0b685fadeb222a61292 (diff) | |
download | haskell-wip/overload-th.tar.gz |
Overloaded Quotation Brackets (#246)wip/overload-th
This patch implements overloaded quotation brackets which generalise the
desugaring of all quotation forms in terms of a new minimal interface.
The main change is that a quotation, for example, [e| 5 |], will now
have type `Quote m => m Exp` rather than `Q Exp`. The `Quote` typeclass
contains a single method for generating new names which is used when
desugaring binding structures.
The return type of functions from the `Lift` type class, `lift` and `liftTyped` have
been restricted to `forall m . Quote m => m Exp` rather than returning a
result in a Q monad.
More details about the feature can be read in the GHC proposal.
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0246-overloaded-bracket.rst
Diffstat (limited to 'libraries/template-haskell/Language/Haskell/TH.hs')
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs index 5b03b2649c..b818535576 100644 --- a/libraries/template-haskell/Language/Haskell/TH.hs +++ b/libraries/template-haskell/Language/Haskell/TH.hs @@ -8,6 +8,7 @@ module Language.Haskell.TH( -- * The monad and its operations Q, runQ, + Quote(..), -- ** Administration: errors, locations and IO reportError, -- :: String -> Q () reportWarning, -- :: String -> Q () @@ -53,7 +54,6 @@ module Language.Haskell.TH( Name, NameSpace, -- Abstract -- ** Constructing names mkName, -- :: String -> Name - newName, -- :: String -> Q Name -- ** Deconstructing names nameBase, -- :: Name -> String nameModule, -- :: Name -> Maybe String @@ -84,7 +84,7 @@ module Language.Haskell.TH( Pat(..), FieldExp, FieldPat, -- ** Types Type(..), TyVarBndr(..), TyLit(..), Kind, Cxt, Pred, Syntax.Role(..), - FamilyResultSig(..), Syntax.InjectivityAnn(..), PatSynType, + FamilyResultSig(..), Syntax.InjectivityAnn(..), PatSynType, BangType, VarBangType, -- * Library functions module Language.Haskell.TH.Lib, |