Version française
Home     About     Download     Resources     Contact us    
Browse thread
Type inference question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Julien Verlaguet <Julien.Verlaguet@p...>
Subject: Type inference question
I have the following function definition :

let myfun param=
   let res=Marshal.from_channel stdin [] in
     if res=param then
       res
     else res
;;

Since the type of "Pervasives.=" is "'a -> 'a -> bool",
I was expecting :

myfun : 'a -> 'a

I got instead :

myfun : 'a -> 'b

Is it normal ?