Gergely Buday wrote:
one more question about the semicolon operator:

when there are a number of<- operators, and a return at the end,
then, the right-associativity of bind let me compute the type of the
expresson

x1<- f y1;
x2<- g y2;
return xml = bind ( f y1) (fn x1 =>  bind (g y2) (fn x2 =>  return xml))

But what can I do when there are more non-<- lines at the end, like

fun write t s =
     oldTail<- get t.Tail;
     newTail<- source End;
     set oldTail (Line (s, newTail));
     set t.Tail newTail

The syntax [e1; e2] is sugar for [bind e1 (fn () => e2)]. I hope that answers the question.

_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to