Task

Write a procedure which accepts as arguments another procedure and a positive integer.

The latter procedure is executed a number of times equal to the accepted integer.




let repeat ~f ~n =
  for i = 1 to n do
    f ()
  done
 
let func () =
  print_endline "Example"
 
let () =
  repeat ~n:4 ~f:func
 