[MLton-user] bug report: vector equality

Sam Lindley Sam.Lindley@ed.ac.uk
Fri, 27 Feb 2004 19:54:23 +0000


Stephen Weeks wrote:
>>In other implementations such as NJ and the release version of mlton 
>>this constraint is transparent, which means the eqtype is visible.
> 
> I view this as a bug in SML/NJ (and in MLton 20030716, which doesn't
> even check that structures match signatures, so this is one of
> innumerable bugs there).

Actually, to be more accurate I should have said Int32Vector isn't 
defined in NJ, but similar structures such as Word8Vector are, and they 
are equality comparable. I guess it is a bug.

>>Actually, having another look at the latest code on the web, I can't see 
>>any opaque constraints on Int32Vector...
> 
> 
> The entire basis is matched opaquely here
> 
> http://cvs.mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/libs/basis-2002/top-level/basis.sml?rev=HEAD&content-type=text/vnd.viewcvs-markup

Ah... now it makes sense. Thanks.

In case you're wondering, the reason this cropped up was in porting the 
SML.NET compiler to mlton. Some of the more obscure code was comparing 
Word8Vectors for equality. I just needed a hack to get it to compile.

It would be nice if mlton supported the NJ withtype extensions. Having 
to inline lots of types makes some code very hard to read.

BTW, SML.NET compile times seem to be around 3-4 times faster when 
SML.NET is compiled under mlton as compared with NJ (110.44).

Sam