(* Force the thunk to compute the second element *)
# tail ();;
- : int stream = Next (2, [fun]) (* Second element: 2 *)
# match tail () with Next (_, rest) -> rest ();;
(* Force the thunk to compute the second element *)
# tail ();;
- : int stream = Next (2, [fun]) (* Second element: 2 *)
# match tail () with Next (_, rest) -> rest ();;