Re: combining signatures
Vesa Karvonen <[email protected]> Mon, 6 Jun 2011 15:10:59 +0300
| Newsgroups | gmane.comp.lang.ml.mlton.devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jun 6, 2011 at 3:28 AM, Michael Norrish <[email protected]> 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