[Header] [Test] (* test 0 *) iter (0, fun x -> x + 1337) 42 [Value] 42 [Test] (* test 1 *) iter (10, fun x -> x + 4) 100 [Value] 140 [Test] (* test 2 *) iter (0, fun x -> x + 3) 300 [Value] 300 [Test] (* test 3 *) iter (3, List.tl) [2; 3; 4; 5; 6; 7] [Value] [5; 6; 7] [Test] (* test 4 *) iter (3, fun s -> s ^ s) "a" [Value] "aaaaaaaa" [Test] (* test 5 *) let rotate_quadraple (x,y,z,w) = (w, x, y, z) in iter (5, rotate_quadraple) (1, 2, 3, 4) [Value] (4, 1, 2, 3) [Test] (* test 6 *) iter (3, fun x -> 2 * x) 1 [Value] 8 [Test] (* test 7 *) iter (3, fun lst -> 2 * List.hd lst :: lst) [1] [Value] [8; 4; 2; 1] [Test] (* test 8 *) iter (3, fun x -> x * x) 2 [Value] 256 [Test] (* test 9 *) let rec mccarthy_91 n = if n > 100 then n - 10 else mccarthy_91 (mccarthy_91 (n + 11)) in iter (125, mccarthy_91) 1337 [Value] 91