[MLton] Re: testing MLton's new front end

Stephen Weeks MLton@mlton.org
Mon, 19 Jan 2004 16:29:03 -0800


> It is very very counter-intuitive to me that the error in
> redundant.sml is reported on line 16 (instead of 19).

I don't know about very very -- both the match and the aliasing are
responsible for the redundancy, so I can't argue strongly on general
principles for reporting only one or the other as the cause.  Clearly
the right thing is to report both.

> Your example of a function being applied multiple times with the
> redundancy only being for some applications certainly seems to argue
> for this case.

Agreed.

> Of course if the functor is large, then the only information you get
> is that the functor could be redundant and that this application
> was, but no indication of where in the body it is.

Right -- if I only am going to report only one location, then the
match is a better one to report, since it is much easier to infer the
containing functor from the match then it is the match from the
functor name.  From there, since functors are typically applied once
or only a few times, it should be easy enough to find the aliasing.

Also, I'm not even sure if a warning should be emitted at all.