(Oh, Gabriel beat me to the punch, but I'll add my reply anyway.)

The standard library is a fairly minimal library of basic features. Not a high-level full-featured library which helps you make good choices. :)

However, the documentation (in .mli files) is fairly clear about what is tail-recursive or not. And there is rev_map:

val rev_map : ('a -> 'b) -> 'a list -> 'b list
(** [List.rev_map f l] gives the same result as
   {!List.rev}[ (]{!List.map}[ f l)], but is tail-recursive and
   more efficient. *)


On Sun, Sep 28, 2014 at 1:31 PM, Shuai Wang <wangshuai901@gmail.com> wrote:
Hello list,


I am working on some stack_overflow exception in our recent project written in OCaml
and eventually it turns out that this exception is thrown by List.map function.

By seeing the source code of OCaml's List module, it seems that map function 
does not be implemented tail-recursively: 

let rec map f = function
    [] -> []
  | a::l -> let r = f a in r :: map f l