Quasi quoting
Sebastian Fischer
sebf at informatik.uni-kiel.de
Wed Feb 3 18:28:45 EST 2010
On Feb 3, 2010, at 6:13 PM, Max Bolingbroke wrote:
>> With a class-based approach only one parser that creates values of
>> the same
>> type could be used in a program.
>
> This is not the case, because you still have an instance "Quoted
> String". Then you can write:
>
> $(myLang [|..|])
>
> Where myLang :: String -> Q Exp
Ah, you're right. I find an instance Quoted String a little
confusing and would probably write $(myLang "..") instead. Hmm, this
is more complicated if the string contains line breaks and [|..|]
would be an alternative string literal syntax where line breaks don't
need to be escaped.
Sebastian
--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)
More information about the Glasgow-haskell-users
mailing list