[web-devel] Hamlet variables: (foo bar) baz or foo (bar baz)

Bardur Arantsson spam at scientician.net
Mon Jan 3 19:49:01 CET 2011


On 2010-12-31 16:06, Felipe Almeida Lessa wrote:
> On Fri, Dec 31, 2010 at 5:31 AM, Aur Saraf<sonoflilit at gmail.com>  wrote:
>> Is it really impossible to just use the plaintext as code in Template
>> Haskell? It would really be nice if you could use any bit of Haskell
>> wherever you can use a variable (but it's just nice-to-have, not worth
>> playing with GHC's code just to get it).
>
> It was until someone else wrote a library for us =) [1].  We just need
> to unpack the QuasiQuoter data type and use it inside Hamlet's
> quasiquoter.
>
> [1] http://hackage.haskell.org/package/haskell-src-exts-qq
>
> Michael, were you aware of this library?
>
> Cheers,
>

It should be noted that the hse-qq library doesn't handle infix operator 
precedence properly.

There are proposals to remedy this; but it requires changes to GHC, see

    http://hackage.haskell.org/trac/ghc/ticket/4430
    http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal

Cheers,




More information about the web-devel mailing list