Hi,
On page 76 of the "Developing Applications with Objective OCaml"
book, it says this:
"Likewise, when you apply a polymorphic value to a polymorphic
function, you get a weak type variable, because you must not exclude
the possibility that the function may construct physically
modifiable values. In other words, the result of the application is
always monomorphic"
Then it gives an example like this:
# (function x -> x) [] ;;
- : '_a list = []
I tried the same in my OCaml 3.09 on Windows XP but got an different
result:
# (function x -> x) [] ;;
- : 'a list = []
As you can see, my version of the OCaml did not produce a week type
but a strong type "list" instead. I understand that the book result
is based on OCaml 2.04. So, what has changed in OCaml 3.09 that led
to such a different result?
Thanks.
Doug
.