7 ms·
With regards to List.map: List.rev_map is also in the standard library and is tail-recursive, so you can just do List.rev(List.rev_map l) to tail recursively ma
by boryas 17y ago
With regards to List.map:
List.rev_map is also in the standard library and is tail-recursive, so you can just do List.rev(List.rev_map l) to tail recursively map. Just had to defend Ocaml a little :)