let mk () = let q = Queue.create () in let f _ = try Some (Queue.take q) with | Queue.Empty -> None in ((Stream.from f), q)