[MLton] combining signatures

Vesa Karvonen vesa.a.j.k at gmail.com
Mon Jun 6 05:10:59 PDT 2011


On Mon, Jun 6, 2011 at 3:28 AM, Michael Norrish
<Michael.Norrish at nicta.com.au> wrote:
> If I have
>
>  signature One =
>  sig
>   eqtype foo
>   val op1 : foo -> ...
>   val op2 :
>   val op3 :
>  end
>
>  signature Two =
>  sig
>   eqtype foo
>   type bar
>   val op4 : bar -> foo
>   val op5 : ...
>  end
>
> is it possible to create a signature that merges One and Two without retyping all of the bindings?
>
> It'd be nice to be able to do
>
>  signature Combined =
>  sig
>    include One
>    include Two
>  end
>
> but, reasonably, there is a complaint about duplicate bindings of foo.
[...]
> If there's some not-too-destructive way of rewriting the One and Two signatures to make subsequent combination work, I'd be on for that too.

Perhaps the technique I described in

  http://mlton.org/pipermail/mlton/2006-December/029469.html

would be workable in your case.

-Vesa



More information about the MLton mailing list