Use "run" instead of direct access to the stream

This commit is contained in:
Tony Garnock-Jones 2012-04-29 08:39:05 -04:00
parent 6273aa4c94
commit 6521950c86
1 changed files with 4 additions and 4 deletions

View File

@ -57,13 +57,13 @@ let rec from_iter f =
cache := Some result;
result)
let rec iter f (Stream s_f) =
match s_f () with
let rec iter f s =
match run s with
| None -> ()
| Some (v, flush, k) -> (f (v, flush); iter f k)
let rec to_list (Stream f) =
match f () with
let rec to_list s =
match run s with
| None -> []
| Some (v, _, k) -> v :: to_list k