Future of Haskell records

George Russell ger@tzi.de
Wed, 10 Sep 2003 13:51:13 +0200


I'm quite happy to have Haskell records remain the way they are.

I've used ML quite a lot, which of course has records without constructors.
But the problem with this is that (1) you get massive error messages;
(2) there isn't a mechanism for filling in empty slots.  I don't think you
really gain anything except the labour of not typing the constructor name.

On the other hand, you would lose the Haskell feature by which when several
constructors all have a record of the same name with the same type, you can extract
that record in one operation.  This is occasionally really useful, see the
spaceships paper in this year's Haskell workshop.

I am definitely against anything which breaks code in any major way, as I'm
sitting on top of 90,000 lines of Haskell, which uses records a lot.  (I like
records.)

Perhaps the only things which could be improved would be :
(1) when some constructors have a field of type X, and others do not, it would be
nice to have a way of getting a Maybe X value out.
(2) I wish there were some way of allowing constructors for different types to
share a record name.  But perhaps the overloading required would make this not
worthwhile.

However neither (1) nor (2) is a priority for me.