#5612: Better support for kinds in Template Haskell
-------------------------------+--------------------------------------------
Reporter: guest | Owner: lunaris
Type: feature request | Status: closed
Priority: low | Milestone: 7.6.1
Component: Compiler | Version: 7.3
Resolution: fixed | Keywords: PolyKinds, TemplateHaskell
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: Other | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
-------------------------------+--------------------------------------------
Changes (by simonpj):
* status: patch => closed
* resolution: => fixed
Comment:
Many thanks to lunaris and Richard Eisenberg. I've just pushed patches to
HEAD to add promoted types and kind polymorphism to Template Haskell.
{{{
commit 0fe0c58ee9758f1606ccd12fd04121a08488fb9a
Author: Richard Eisenberg <[email protected]>
Date: Tue May 15 13:42:46 2012 -0400
Applied lunaris's patch to allow promoted types and rich kinds in
Template Haskell
compiler/deSugar/DsMeta.hs | 552
++++++++++++++++++++++++---------------
compiler/hsSyn/Convert.lhs | 179 ++++++++------
compiler/prelude/TysWiredIn.lhs | 2 +-
compiler/typecheck/TcSplice.lhs | 46 +++-
compiler/types/TyCon.lhs | 11 +
5 files changed, 497 insertions(+), 293 deletions(-)
commit 869044056c54dfe95017c19bef5274b748cfe724
Author: Simon Peyton Jones <[email protected]>
Date: Fri May 18 10:10:28 2012 +0100
Wibbles to lunaris's patch for promoted kinds
compiler/deSugar/DsMeta.hs | 18 +++++++-----------
compiler/hsSyn/Convert.lhs | 9 ++++++---
2 files changed, 13 insertions(+), 14 deletions(-)
}}}
There are corresponding patches in `libraries/template-haskell` of course:
{{{
commit 5d36a74d115cb7c4c12a6c3bcc369e320fe1d1b3
Author: Simon Peyton Jones <[email protected]>
Date: Fri May 18 10:06:17 2012 +0100
Change TH syntax to allow promoted kinds and kind polymorphism
The big change here is that Kind is no longer a distinct type,
it's just a type synonym for Type. This reflects exactly what
happens in the HsSyn world, and avoids a great deal of duplication
between types and kinds. But it is a breaking for (the few)
TH users who were using the constructors for Kind.
Thanks to lunaris and Richard Eisenberg for doing the work.
Language/Haskell/TH.hs | 20 +++++++++-----
Language/Haskell/TH/Lib.hs | 40 ++++++++++++++++++++++++---
Language/Haskell/TH/Ppr.hs | 38 +++++++++++++++------------
Language/Haskell/TH/Syntax.hs | 58
++++++++++++++++++++++++++++++++++++-----
4 files changed, 120 insertions(+), 36 deletions(-)
}}}
Richard and/or lunaris also provided some tests in `tests/th`.
Thanks all!
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5612#comment:24>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs