[comp.lang.functional] overloading, subtypes, and arrays missed in SML

corvara@ztivax.UUCP (Dr Gerd Venzl) (06/13/91)

I've been wondering about the motivations for some decisions made in the
design of Standard ML. They concern a couple of useful concepts well known
from imperative languages, namely overloading, subtypes, and arrays. While
these could certainly provide there benefits in a functional setting as well
they have been omitted in the definition of SML.

Subtypes and (finite) arrays (if viewed as mappings from some finite subtype
to some element type) are closely related and a natural means of modeling
in many applications. Of course subtypes introduce problems for static type
checking but for the benefits they give me I'm happily prepared to pay the
cost of a little explicit typing.

Concerning overloading in SML the situation is even worse because it is
inconsistent. While it is used for a couple of predefined operators (together
with the need for explicit typing of expressions like op +) there is no way
for the user to introduce overloaded operators of his own. And while the
labelled record selectors of form #<name> are overloaded there is no way
to write an equally powerful selector using variable indices for direct
tuple element access. Instead you have to redo it using different names for
every single tuple type you need.

Could anyone point out to me the substantial reasons and problems that lead
to the omittance of the three named concepts in SML? Have these concepts
been embedded in other functional languages?

Please reply by email, I'll summarize.

Torsten Roessel
Siemens Corporate Research & Development
Design Automation Department
InterNet: roessel@ztivax.siemens.com

rockwell@socrates.umd.edu (Raul Rockwell) (06/14/91)

Torsten Roessel:
   I've been wondering about the motivations for some decisions made
   in the design of Standard ML. They concern a couple of useful
   concepts well known from imperative languages, namely overloading,
   subtypes, and arrays. While these could certainly provide there
   benefits in a functional setting as well they have been omitted in
   the definition of SML.

Arrays are defined in the SML library.

-- 
Raul <rockwell@socrates.umd.edu>

spot@asd.sgi.com (Scott Draves) (06/18/91)

In article <ROCKWELL.91Jun14000323@socrates.umd.edu> rockwell@socrates.umd.edu (Raul Rockwell) writes:

   Arrays are defined in the SML library.

true, but they are statefull (like a ref). sigh.