0 results from MLton.size

Matthew Fluet Matthew Fluet <fluet@CS.Cornell.EDU>
Tue, 6 Nov 2001 19:10:32 -0500 (EST)


> Speaking of this, what is the reason for the single arm  datatype?   Why  not
> just  make  it  be the underlying record?  Is this only because you don't use
> opaque signatures so that it would be too easy  to  get  confused  about  the
> type?

One reason is "sharing".  You can't have sharing between two structures
make two record types be equal (in strict SML), but you can have it make
two datatypes be equal.

The other reason is that it helps type inference on records.  I can write

fn S.T {a, ...} => 

and the constructor T carries enough typing information to get the type of
the record correct.  In many cases,

fn {a, ...} => 

would leave you with a flexible record error.