RosettaCodeData/Task/Loops-Do-while/OCaml/loops-do-while-2.ml

8 lines
145 B
OCaml

let do_while f p =
let rec loop() =
f();
if p() then loop()
in
loop()
(** val do_while : (unit -> 'a) -> (unit -> bool) -> unit *)