English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Private types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-11-01 (13:31)
From: Edgar Friendly <thelema314@g...>
Subject: Re: [Caml-list] Re: Private types
Rémi Vanicat wrote:
> Edgar Friendly <thelema314@gmail.com> writes:
>> Does the compiler really get any information from an explicit cast that
>> it can't figure out already?  I can't come up with any example.
> you mean as in the following function ? 
> let f x = (x : t :> t')
Well, yes and no.  That function in a vacuum doesn't have enough
information to infer types t and t', but within a larger program, if it
gets used in a manner other than ('a -> 'a), the cast should be obvious, no?