[MLton] deepFlatten exception

Stephen Weeks sweeks@sweeks.com
Thu, 22 Jun 2006 10:49:47 -0700


> I could imagine that another (possibly) sensible use of MLton.eq by
> a user is to assert that some expected sharing is actually
> happening.  But, it may be that the optimizer never guarantees that.

Yeah, with all of MLton's flattening and representation-chaning
optimizations, that is tough to guarantee.  My thinking for MLton_eq
is that if things happen to be pointers, it does something sensible
(i.e. pointer equality), but if not, then who knows.  Someday I'd like
to see a "boxed" type or somesuch added to MLton so that people can
force indirection for performance reasons when they want.  I would
guess that we can add an eq for the boxed type that has sensible
semantics, since we'll know it's a pointer.