[MLton] withtype in signature?

Wesley W.Terpstra wesley@terpstra.ca
Tue, 6 Sep 2005 13:49:31 +0200


I want to have something like
     datatype test = A of foo * baz | B
     withtype foo = string * test
     and baz = int
in a signature, but I see that it is explicitly forbidden by ml.grm.

Why is 'withtype' not allowed in signatures? The standard?
How do I achieve the same effect? (a public recursive datatype)

I know that I could simply replace all the occurrences of foo
and baz in the public definition, like:

datatype test = A of (string * test) * int | B
type foo = string * test
and baz = int

However, this seems rather silly; in the real source code, the
abbreviation greatly improves readability and brevity. One would
think that is most important in the context of signatures...