1
0
mirror of https://github.com/dhil/phd-dissertation synced 2026-03-12 18:48:25 +00:00

Update code

This commit is contained in:
2020-10-27 00:58:20 +00:00
parent 8700c0f439
commit e2af947cbd
3 changed files with 31 additions and 8 deletions

View File

@@ -545,15 +545,13 @@ fun init(fsys, main) {
### Stream redirection
###
sig >> : (Comp(a, { Create: (String) -> FileDescr
, Open: (String) {}-> Option (FileDescr)
, Write:(FileDescr, String) -> () |e}), String)
{ Create:(String) -> FileDescr
, Open:(String) -> Option (FileDescr)
, Write:(FileDescr, String) -> () |e}~> ()
, Write:(FileDescr, String) -> () |e}~> a
op f >> fname {
var fd = create(fname);
handle(f()) {
case Return(_) -> ()
case Return(x) -> x
case Write(_, cs, resume) ->
resume(write(fd, cs))
}