[Haskell-cafe] Template Haskell: onward and upward

Brandon Moore brandon_m_moore at yahoo.com
Tue Oct 19 12:54:25 EDT 2010

>From: Simon Peyton-Jones <simonpj at microsoft.com>
>Sent: Mon, October 18, 2010 5:02:57 PM
>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.
>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.



More information about the Haskell-Cafe mailing list