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.




fun repeat (_, 0) = ()
  | repeat (f, n) = (f (); repeat (f, n - 1))
 
fun testProcedure () =
  print "test\n"
 
val () = repeat (testProcedure, 5)