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: Andreas Rossberg <rossberg@p...>
Subject: Re: [Caml-list] bizarre type
Julien Verlaguet wrote:
> 
> 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

In this case, t is fully abstract. So int t is only equivalent to 
itself, and not to arbitrary x t.

-- 
Andreas Rossberg, rossberg@ps.uni-sb.de

Let's get rid of those possible thingies!  -- TB