Commits

camlspotter committed 9e0267e

added mapi

Comments (0)

Files changed (1)

       | x::xs -> f n x; iter (n+1) xs
     in
     iter 0 l
+
+  let mapi f l = 
+    let rec map n = function
+      | [] -> []
+      | x::xs -> f n x :: map (n+1) xs
+    in
+    map 0 l
 end