datatype rlist = Nil | Cons of {Data : source string,
NewData : source string,
Tail : source rlist}
fun showString ss =
s <- signal ss;
return {[s]}
fun show rls =
v <- signal rls;
show' v
and show' rl =
case rl of
Nil => return
| Cons {Data = ss, NewData = ss', Tail = rls} => return
fun main () =
head <- source Nil;
tailP <- source head;
data <- source "";
let
fun add () =
data <- get data;
data <- source data;
ndata <- source "";
tail <- get tailP;
tail' <- source Nil;
let
val cons = Cons {Data = data, NewData = ndata, Tail = tail'}
in
set tail cons;
set tailP tail';
head' <- get head;
case head' of
Nil => set head cons
| _ => return ()
end
in
return