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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: micha <micha-1@f...>
Subject: Re: [Caml-list] phantom type thing question
Am Thu, 1 Mar 2007 14:47:47 +0100
schrieb "Olivier Andrieu" <oandrieu@gmail.com>:

> On 3/1/07, micha <micha-1@fantasymail.de> wrote:
> >
> if you want subtyping, you'll need to add a variance annotation to
> your type parameter. Otherwise since your type sym is abstract, you'll
> get no subtyping at all. In this case you probably want a
> contravariant type parameter:
> 
> type -'a sym

o.k., but after reading section 6.8.1 of the manual I don't see why it
needs to be -'a and not +'a


> that should be:
> val get_image_width : [> xpm] sym -> int

thanks, that helped,


 Michael