The Future of Haskell discussion at the Haskell Workshop

Gregory Morrisett jgm@cs.cornell.edu
Tue, 9 Sep 2003 14:50:23 -0400


Coming from the ML world, I can say that I find the lack of
proper records a real loss.  It is extremely convenient to
write functions which take many parameters as taking a record,
for then you don't have to worry so much about the order
of arguments.  SML gets this much right, but the ad hoc
treatment of record selection in SML is a royal pain.  Haskell
has all of the machinery needed to support this nicely
so it seems a shame for it to be omitted.

I can say from experience that forcing records to be declared
(as in Ocaml) so that there is at most one record type that
a given label can come from in any given scope is a royal
pain.  You're then forced to come up with unique names for
the labels so that you don't get a conflict (much as we have
to do with datatype constructors.)  In Ocaml, you tend to get
around this by putting the record types in different modules,
but this is only marginally better namespace control.

Neither SML nor Ocaml supports polymorphic record selection
which is absolutely crucial.  I've found few needs for extension
or polymorphic update, though there are some compelling
examples, and I suspect that more will crop up if these
features are widely available. =20

Finally, it seems that good record support at the core level
is a nice stepping stone to (first-class) modules. =20

-Greg