(* see List.map *) let map f = let rec mp xs = match xs with [] -> [] | x :: xs -> f x :: mp xs in mp (* try: map (function x -> x + 1) [3;5;7];; let f = map (function x -> x + 1);; f[2;4;6];; f[3;4;5];; *)