equal
deleted
inserted
replaced
42 (*return next sequence element as None or Some (x, xq)*) |
42 (*return next sequence element as None or Some (x, xq)*) |
43 fun pull (Seq f) = f (); |
43 fun pull (Seq f) = f (); |
44 |
44 |
45 |
45 |
46 (*the empty sequence*) |
46 (*the empty sequence*) |
47 val empty = make (fn () => None); |
47 val empty = Seq (fn () => None); |
48 |
48 |
49 (*prefix an element to the sequence -- use cons (x, xq) only if |
49 (*prefix an element to the sequence -- use cons (x, xq) only if |
50 evaluation of xq need not be delayed, otherwise use |
50 evaluation of xq need not be delayed, otherwise use |
51 make (fn () => Some (x, xq))*) |
51 make (fn () => Some (x, xq))*) |
52 fun cons x_xq = make (fn () => Some x_xq); |
52 fun cons x_xq = make (fn () => Some x_xq); |