[Haskell] Re: Proposal: Allow "\=" for field update in record
update syntax
Andre Pang
ozone at algorithm.com.au
Sat Feb 19 06:33:00 EST 2005
On 19/02/2005, at 5:20 AM, Keean Schupke wrote:
> Yes, your idea is much nicer... I was just suggesting TH as a way to
> implement custom syntax... It would be nice if come sort of standard
> existed for template-haskell so that other compilers/interpreters
> could adopt it. A portable template would be a cool thing.
The $(...) syntax that you need at the splice site greatly diminishes
the potential for Template Haskell to be used as syntax, unfortunately.
The interesting (or frustrating?) thing is that Template Haskell
implements the majority of the hard work needed for a proper hygienic
macro system, but unfortunately doesn't go quite the extra mile to
enable you to actually define new syntax. I suspect all you'd need is
a way to annotate the function you wanted to use as a macro, so that
the compiler knows that the function should always be spliced in,
rather than be explicitly spliced in at the call site. (People who
know better, shoot me down if I'm wrong ...)
I'd actually go so far blame the lack of macro support in TH on the
Haskell community as a whole, since the general consensus I get from
e.g. the mailing lists is that "syntactic sugar is bad".
--
% Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>
More information about the Haskell
mailing list