[MLton] show-basis parentheses hack

Stephen Weeks MLton@mlton.org
Fri, 16 Sep 2005 10:46:10 -0700


> I'm not entirely sure about where new "plain old" datatypes should
> be placed (in the MLton framework). Since the new datatype I
> introduced is required in multiple different places, I just (lazily)
> moved the datatype to a top-level structure BS (I intentionally
> chose an ugly name) and exported the structure in the MLB file. (If
> you think that the algorithm is otherwise worth incorporating into
> MLton, I'll be happy to restructure the implementation to conform to
> MLton conventions.)

It looks good.  The way to incorporate it is to rename structure BS as
BindingStrength, rename the type as t, and make BindingStrength a
substructure of PRIM_TYCONS.  That will make it available at all the
places it is needed.

signature BINDING_STRENGTH =
   sig
      type t

      val arrow: t
      val tuple: t
      val unit: t
   end

signature PRIM_TYCONS =
   sig
      ...
      structure BindingStrength: BINDING_STRENGTH
      ...
      val layoutApp:
         tycon * (Layout.t * {isChar: bool} * BindingStrength.t) vector
         -> Layout.t * {isChar: bool} * BindingStrength.t
   end