let f x = 0;;
(** val f : 'a -> int = **)
let g x = failwith "!";;
(** val g : 'a -> 'b = **)
let aint f x = (f x) + 0;;
(** val aint : ('a -> int) -> 'a -> int = **)
let test1 = aint f;;
(** val test1 : 'a -> int = **)
let test2 = aint g;;
(** val test2 : 'a -> int = **)
(** This was really unexpectable for me. I supposed
that one of the versions ought to seem incorrect
for the compiler. Ok, let's check them... **)
let res1 = test1 1;;
let res2 = test2 1;;
(** val res1 : int = 0 **)
(** Exception: Failure "!". **)
(** I might not understand something important, but it seems
quite strange. Looks like both of them work properly =)
Well then, let's have some more fun...**)
let inta f x = let _ = f 0 in 0;;
(** val inta : (int -> 'a) -> 'b -> int = **)
let test1 = inta f;;
(** val test1 : '_a -> int = **)
let test2 = inta g;;
(** val test2 : '_a -> int = **)
let res1 = test1 1;;
let res2 = test2 1;;
(** val res1 : int = 0 **)
(** Exception: Failure "!". **)
(** Same result. **)
(** Drawing a conclusion, I can say that OCaml compiler does
not differ types 'a and int. WTF?! **)