RosettaCodeData/Task/Loops-Do-while/OCaml/loops-do-while-2.ocaml
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

7 lines
145 B
Text

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