Template Haskell: allow type splices
authorsimonpj@microsoft.com <unknown>
Wed, 27 May 2009 18:12:42 +0000 (18:12 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 27 May 2009 18:12:42 +0000 (18:12 +0000)
commit389cca214f33a29646e08d57e3dca862140007b2
tree8154ffd0215228f3f6951481f7b2c73fc85d4d39
parent97a8fe8780307e95829034117efa98d2e27109cd
Template Haskell: allow type splices

At last!  Trac #1476 and #3177

This patch extends Template Haskell by allowing splices in
types.  For example

  f :: Int -> $(burble 3)

A type splice should work anywhere a type is expected.  This feature
has been long requested, and quite a while ago I'd re-engineered the
type checker to make it easier, but had never got around to finishing
the job.  With luck, this does it.

There's a ToDo in the HsSpliceTy case of RnTypes.rnHsType, where I
am not dealing properly with the used variables; but that's awaiting
the refactoring of the way we report unused names.
compiler/parser/Parser.y.pp
compiler/rename/RnExpr.lhs
compiler/rename/RnSource.lhs
compiler/rename/RnTypes.lhs
compiler/typecheck/TcHsType.lhs
compiler/typecheck/TcMType.lhs
compiler/typecheck/TcSplice.lhs
compiler/typecheck/TcSplice.lhs-boot
compiler/typecheck/TcType.lhs