adam@1800: datatype lines = End | Line of source lines
adam@1800:
adam@1800: type t = { Head : source lines, Tail : source (source lines) }
adam@1800:
adam@1800: val create =
adam@1800: head <- source End;
adam@1800: tail <- source head;
adam@1800: return {Head = head, Tail = tail}
adam@1800:
adam@1800: fun renderL lines =
adam@1800: case lines of
adam@1800: End =>
adam@1800: | Line linesS => X
adam@1800:
adam@1800: and renderS linesS =
adam@1800: lines <- signal linesS;
adam@1800: return (renderL lines)
adam@1800:
adam@1800: fun render t = renderS t.Head
adam@1800:
adam@1800: fun write t =
adam@1800: oldTail <- get t.Tail;
adam@1800: newTail <- source End;
adam@1800: set oldTail (Line newTail);
adam@1800: set t.Tail newTail
adam@1800:
adam@1800: fun main () : transaction page =
adam@1800: b <- create;
adam@1800:
adam@1800: return
adam@1800: