[MLton] Show type at point / OCaml -dtypes

Vesa Karvonen vesa.karvonen@cs.helsinki.fi
Wed, 27 Jul 2005 22:47:28 +0300


Quoting Stephen Weeks <sweeks@sweeks.com>:
> I agree; -show-types would be nice.  It doesn't seem too hard.  One
> could tweak elab{Exp,Pat} in elaborate-core.fun to add to some global
> list a pair of the region and the type.  Then, once type inference is
> complete, spit out all the pairs to the file.

I haven't yet looked into implementing the feature in detail, but is
it really necessary to modify the elaborate pass? Would it be possible
to output the info based on the intermediate language produced by the
elaborate pass? In other words, does[n't] the intermediate language
produced by elaborate contain both the exact source region and the exact
type information? Using a separate pass could have the advantage that
the feature might be implemented considerably more modularly.

-Vesa Karvonen