Wrong argument in chapter 1.3 in ocaml manual

documentation
#1

I found a wrong code in chapter 1.3 of “The OCaml system release 4.07 Documentation and user’s manual” in http://caml.inria.fr/pub/docs/manual-ocaml/coreexamples.html
It says bellow sample codes
But it doesn’t work well

 List.map (function n -> n * 2 + 1) [0;1;2;3;4];;
- : int list = [1; 3; 5; 7; 9]

This sample code is just wrong. In OCaml 4.07.1, the code returns bellow error message.

 List.map (function n -> n * 2 + 1) [0;1;2;3;4];;
Error: This expression should not be a function, the expected type is
'a Core.List.t

The right sample code is:

 List.map ~f:(function n -> n * 2 + 1) [0;1;2;3;4];;
- : int list = [1; 3; 5; 7; 9]
#2

Both the code in the manual and your code are correct: you are using an alternative standard library called core Core, whereas the manual is using the regular standard library.

#3

Oh, you’re right. I forget “open Core” in .ocamlinit