[project @ 2003-11-06 17:09:50 by simonpj]
authorsimonpj <unknown>
Thu, 6 Nov 2003 17:10:01 +0000 (17:10 +0000)
committersimonpj <unknown>
Thu, 6 Nov 2003 17:10:01 +0000 (17:10 +0000)
commit1f5e55804b97d2b9a77207d568d602ba88d8855d
tree084c7356bc35f7b74d18421531ca1b285aef6a2a
parent599e42c2948811e71607c5167d9345ddd74d83c3
[project @ 2003-11-06 17:09:50 by simonpj]
------------------------------------
Major increment for Template Haskell
------------------------------------

1.  New abstract data type "Name" which appears where String used to be.
    E.g.  data Exp = VarE Name | ...

2.  New syntax 'x and ''T, for quoting Names.  It's rather like [| x |]
    and [t| T |] respectively, except that

a) it's non-monadic:  'x :: Name
b) you get a Name not an Exp or Type

3.  reify is an ordinary function
reify :: Name -> Q Info
    New data type Info which tells what TH knows about Name

4.  Local variables work properly.  So this works now (crashed before):
f x = $( [| x |] )

5.  THSyntax is split up into three modules:

  Language.Haskell.TH TH "clients" import this

  Language.Haskell.TH.THSyntax data type declarations and internal stuff

  Language.Haskell.TH.THLib Support library code (all re-exported
by TH), including smart constructors and
pretty printer

6.  Error reporting and recovery are in (not yet well tested)

report :: Bool {- True <=> fatal -} -> String -> Q ()
recover :: Q a -> Q a -> Q a

7.  Can find current module

currentModule :: Q String

Much other cleaning up, needless to say.
29 files changed:
ghc/compiler/basicTypes/Name.lhs
ghc/compiler/basicTypes/OccName.lhs
ghc/compiler/basicTypes/RdrName.lhs
ghc/compiler/basicTypes/UniqSupply.lhs
ghc/compiler/basicTypes/Unique.lhs
ghc/compiler/basicTypes/Var.lhs
ghc/compiler/deSugar/DsExpr.lhs
ghc/compiler/deSugar/DsForeign.lhs
ghc/compiler/deSugar/DsMeta.hs
ghc/compiler/deSugar/DsMonad.lhs
ghc/compiler/hsSyn/Convert.lhs
ghc/compiler/hsSyn/HsExpr.lhs
ghc/compiler/iface/LoadIface.lhs
ghc/compiler/main/ErrUtils.lhs
ghc/compiler/parser/Lexer.x
ghc/compiler/parser/Parser.y
ghc/compiler/prelude/PrelNames.lhs
ghc/compiler/rename/RnEnv.lhs
ghc/compiler/rename/RnExpr.lhs
ghc/compiler/rename/RnSource.lhs
ghc/compiler/typecheck/TcClassDcl.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcHsSyn.lhs
ghc/compiler/typecheck/TcHsType.lhs
ghc/compiler/typecheck/TcRnDriver.lhs
ghc/compiler/typecheck/TcRnMonad.lhs
ghc/compiler/typecheck/TcSplice.lhs
ghc/compiler/typecheck/TcUnify.lhs
ghc/compiler/utils/UniqFM.lhs