[MLton] Minor front-end extension
Stephen Weeks
MLton@mlton.org
Wed, 11 Aug 2004 09:30:13 -0700
> I was thinking it could be very useful for us to have an option
> which rejects toplevel structure definitions without signature
> constraints.
This feels like a very strong restriction. I guess the motivation is
to prevent accidentally exposing identifiers that should be hidden?
Would you require the constraint to be syntactically in the structure
binding, as in
structure S: SIG = ...
or would you only require that the components of the structure have
been constrained at some point? Consider the following.
* structure T: SIG = ...
structure S = T
* structure T: SIG = ...
structure S = T.U
* structure T: SIG = ...
structure S = struct open T end
* structure T: SIG = ...
structure S = struct open T.U end
* structure S = struct ... end : SIG
* structure S = let ... in struct ... end : SIG end
* functor F (): SIG = ...
structure S = F ()
* functor F () = struct ... end : SIG
structure S = F ()
It's not entirely clear to me what you want to do about structure S in
the above situations.