Advertisement
Guest User

Untitled

a guest
May 29th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. datatype 'a stream = Cons of 'a * (unit -> 'a stream);
  2.  
  3. fun merge (Cons(a, f)) (s2) = Cons(a, fn () => merge s2 (f()));
  4.  
  5. fun flatten (Cons(Cons(a, f), g)) = Cons(a, fn () => merge (f()) (flatten (g())));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement