Template Haskell: onward and upward

Folks Following lots of feedback from users, especially at ICFP, I've evolved some proposals for Template Haskell, that should make it both more expressive, and more secure. http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal Do let me know what you think. Discussion by email is fine (cc me if it's on Haskell-cafe), or comments direct on the Trac. (None of this will be in GHC 7.0; it's a proposed plan for post-release improvements.) Thanks Simon

Since you are proposing creating an abstract type TExp that can't be created manually in contrast to Exp, I have a question that might simply be a reflection of ignorance on my part on how TH works now. As far as I can tell by looking through the documentation, when I want to create an identifier with a computed name I have to build up the AST manually rather than by using quoters since there is no way to splice an identifier name into a quoter. Does this mean that it will not be possible to construct a TExp with a computed identifier name, since one can only use the quoter syntax and not manual construction? Thanks, Greg On 10/18/10 3:02 PM, Simon Peyton-Jones wrote:
Folks
Following lots of feedback from users, especially at ICFP, I've evolved some proposals for Template Haskell, that should make it both more expressive, and more secure.
http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal
Do let me know what you think. Discussion by email is fine (cc me if it's on Haskell-cafe), or comments direct on the Trac.
(None of this will be in GHC 7.0; it's a proposed plan for post-release improvements.)
Thanks
Simon
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

From: Simon Peyton-Jones
Sent: Mon, October 18, 2010 5:02:57 PM Folks
Following lots of feedback from users, especially at ICFP, I’ve evolved some proposals for Template Haskell, that should make it both more expressive, and more secure.
http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal
Do let me know what you think. Discussion by email is fine (cc me if it’s on Haskell-cafe), or comments direct on the Trac.
A and B are both excellent ideas. Less typechecking makes it easier to provide sugar for operations that cannot be expressed nicely in the current type system, and also to experiment with syntax. One example is $(tmap 'Con [| [a, b, c, d] |]) => [Con a, Con b, Con c, Con d] Another would be experimenting with monadic-case syntax by making a macro that rewrites top-level case statements in a quoted do block. Case B starts to provide the sorts of static guarantees that begin to justify (by using the result) the restrictions imposed by typechecking splices ahead of time. In D, adding a parseHaskell quasiquoter is an excellent idea. This should be the proper fixpoint including all the current quasiquoters. That might be easier to implement if the Haskell parser is passed as an argument to the quasiquoters, rather than exposed as a binding in a module. Brandon
participants (3)
-
Brandon Moore
-
Gregory Crosswhite
-
Simon Peyton-Jones