[MLton] array flattening

Stephen Weeks MLton@mlton.org
Fri, 9 Jul 2004 09:54:19 -0700

> No, I am talking about the space used just after you execute
> 	Array.array (1000000, (0, 0))
> With the current indirection, all the array slots share the same int * int,
> so it is just 4 bytes per element plus the header for a single array and
> the header for the single tuple.

You are right.  There are ways to attempt to fake out MLton's
optimizer, e.g., by making the element type "(int * int) option"
instead of "int * int".  But they are really too brittle.