mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-11-07 22:53:41 +01:00
14 lines
268 B
OCaml
14 lines
268 B
OCaml
|
(* Single process function *)
|
||
|
let run_sequential f stream =
|
||
|
|
||
|
let rec next _ =
|
||
|
try
|
||
|
let task = Stream.next stream in
|
||
|
Some (f task)
|
||
|
with Stream.Failure -> None in
|
||
|
Stream.from next
|
||
|
|
||
|
let run ?(ordered=true) ~f stream =
|
||
|
run_sequential f stream
|
||
|
|