[Haskell-cafe] Re: Multi-line string literals are both easy /and/ elegant in Haskell

Matt Morrow mjm2002 at gmail.com
Tue Oct 14 19:52:07 EDT 2008

> How exactly QuasiQuote behave, and what
> is available to handle them? (Or: can I
> find information already on the web?)

A QuasiQuoter is

data QuasiQuoter
  = QuasiQuoter {quoteExp :: String -> Q Exp,
                 quotePat :: String -> Q Pat}
        -- Defined in Language.Haskell.TH.Quote

There is a good writeup on the haskell.org wiki, and a link to a paper there.

> Sugestion: what about tex like syntax,
> i.e., change of line is a space, blank
> line is a newline (so that we could
> reformat the string without changing
> content)?

GHC hands you a String, and you can do arbitrary things
with it before you eventually return either an ExpQ or PatQ
(depending on context). I've uploaded a few QQs to hackage


and am working on both one for Haskell itself, as well as as for Javascript.

> Best,
> Maurício


More information about the Haskell-Cafe mailing list