[Haskell-cafe] Re: [Haskell] Re: Re: RE: Extensible records: Static duck typing

Ben Franksen ben.franksen at online.de
Fri Feb 22 20:17:46 EST 2008

Mark P Jones wrote:
> Ben Franksen wrote:
>> TREX seems to be generally agreed to be too complicated to implement and
>> explain.
> What evidence do you have for this?

Not much, I have to admit that. It basically seems to be SPJ's opinion, as
he writes in his proposal that he "never got around to implementing [TREX]
in GHC. Why not? Mainly because the implementation cost turned out to be
relatively high" and further claims his new proposal "is considerably
simpler to implement, and [...] it is rather simpler to explain."

I also had the impression from earlier discussions that there are few people
who support the TREX idea. I could be completely wrong, though.

> Speaking as somebody who
> implemented Trex for Hugs (and who also witnessed Ben Gaster
> build an independent implementation), I'd have to disagree
> about the first part of this.  As I recall, the implementation
> was reasonably straightforward, and wasn't any more complicated
> than other common type system extensions that I've worked on.
> I'm also not sure why you think it is complicated to explain,
> but I suppose that's even more subjective.

I did not say, nor did I want to imply, that this is my own opinion. I would
be extremely happy to have TREX in ghc and all the other implementations, I
just fear that it is not going to happen, at least not any time soon. In
fact I am almost completely un-biased as to which record system Haskell
gets, as long as DOES get one and preferably IN MY LIFETIME. I'd give up a
serious amount of expressive power if it brings us nearer to this goal.
Maybe this is just me being short-sighted and egotistical.

> One of the most difficult things about the Trex implementation
> was finding a syntax that meshed nicely with the rest of the
> Haskell syntax. This is likely to be a problem for any record
> system extension of Haskell---unless you're prepared to accept
> a more unconventional syntax---because many of the symbols that
> you might want to use ({, }, ., |, \, for example) have already
> been adopted for other purposes.  Ah, syntax!

Oh yes, that is indeed quite hard. One more reason for me to a prefer a
simpler system.


More information about the Haskell-Cafe mailing list