diff options
author | simonpj@microsoft.com <unknown> | 2008-01-18 15:10:16 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2008-01-18 15:10:16 +0000 |
commit | 164d14e1fca14b09e1d435fced8c8ce3fcc1df81 (patch) | |
tree | 98d44731f26c8a64b7d7919bb444c6f411e75490 /libraries/template-haskell/template-haskell.cabal | |
parent | 6758b39fdb68c1b15de73fdaaf5a900cf0447fb7 (diff) | |
download | haskell-164d14e1fca14b09e1d435fced8c8ce3fcc1df81.tar.gz |
Support code for quasi-quotation feature
This patch supports the quasi-quotation feature. Here's the relevant
parts from the message in the big compiler patch:
Fri Jan 18 14:55:03 GMT 2008 simonpj@microsoft.com
* Add quasi-quotation, courtesy of Geoffrey Mainland
This patch adds quasi-quotation, as described in
"Nice to be Quoted: Quasiquoting for Haskell"
(Geoffrey Mainland, Haskell Workshop 2007)
Implemented by Geoffrey and polished by Simon.
...snip...
* There is an accompanying patch to the template-haskell library. This
involves one interface change:
currentModule :: Q String
is replaced by
location :: Q Loc
where Loc is a data type defined in TH.Syntax thus:
data Loc
= Loc { loc_filename :: String
, loc_package :: String
, loc_module :: String
, loc_start :: CharPos
, loc_end :: CharPos }
type CharPos = (Int, Int) -- Line and character position
So you get a lot more info from 'location' than from 'currentModule'.
The location you get is the location of the splice.
This works in Template Haskell too of course, and lets a TH program
generate much better error messages.
* There's also a new module in the template-haskell package called
Language.Haskell.TH.Quote, which contains support code for the
quasi-quoting feature.
Diffstat (limited to 'libraries/template-haskell/template-haskell.cabal')
-rw-r--r-- | libraries/template-haskell/template-haskell.cabal | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libraries/template-haskell/template-haskell.cabal b/libraries/template-haskell/template-haskell.cabal index e4de59dad5..2dfef4b873 100644 --- a/libraries/template-haskell/template-haskell.cabal +++ b/libraries/template-haskell/template-haskell.cabal @@ -12,6 +12,7 @@ exposed-modules: Language.Haskell.TH.PprLib, Language.Haskell.TH.Ppr, Language.Haskell.TH.Lib, + Language.Haskell.TH.Quote, Language.Haskell.TH -- We need to set the package name to template-haskell (without a -- version number) as it's magic. |