[Ur] typing bind

Gergely Buday gbuday at gmail.com
Wed Aug 24 08:10:47 EDT 2011


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

does it have the usual imperative typing

e1: t1   e2 : t2
--------------------
(e1;e2) : t2

?

- Gergely



More information about the Ur mailing list