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 So my question is: *Why would OCaml's implementation List.map like this? * In my humble option, it definitely should be written in a tail-recursive way, and it not, stack_overflow would be unavoidable. For example in order to handle the exception, I abandon the code using List.map and rewrite it into a tail-recursive help function. Best, Shuai