One may write “fun {a:t@ype}{b:t@ype} f” or “fun {a,b:t@ype} f”. My guess
is that the only difference between these two syntaxes, is about the use of
“{…}”: is that it? And that it does not make a difference with regard to
“{…}”?
I’m actually reviewing INT2PROGINATS a second time, that’s how this
question came to me.
The difference lies in the way in which template arguments
are provided:
fun
{a:t0p}
{b:t0p}
foo (x: a, y: b) = (x, y)
val _ = foo (0, “1”)
val _ = foo (0, “1”)
fun
{a,b:t0p}
foo2 (x: a, y: b) = (x, y)
val _ = foo2 (0, “1”)
val _ = foo2<int,string> (0, “1”)
Currently, template arguments need to be all supplied or all omitted.On Monday, February 2, 2015 at 3:23:18 PM UTC-5, Yannick Duchêne wrote:
One may write “fun {a:t@ype}{b:t@ype} f” or “fun {a,b:t@ype} f”. My guess
is that the only difference between these two syntaxes, is about the use of
“{…}”: is that it? And that it does not make a difference with regard to
“{…}”?
I’m actually reviewing INT2PROGINATS a second time, that’s how this
question came to me.