Version française
Home     About     Download     Resources     Contact us    
Browse thread
bizarre type
[ 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: Re: [Caml-list] bizarre type


> The compiler just infers the most general type.

Ok.

But if I write :

# type 'a t;;
type 'a t

# let g (x : 'a t list) (y : 'a)=();;
val g : 'a t list -> 'a -> unit = <fun>

# g ([] : int t list);;
- : int -> unit = <fun>

If I understood well what you just said the inferred type should be :

'_a -> unit

Or is there something I missed there ?

J