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
Type constraints
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-08 (12:39)
From: Alain Frisch <Alain.Frisch@i...>
Subject: Re: [Caml-list] Type constraints
Damien Doligez wrote:
> Hmmm...  Now I don't know whether it's safe or not, and I don't know
> whether someone checked its safety before excluding it from the value
> restriction code...

With this extra line added to is_nonexpansive:

   | Texp_letmodule (_,_,e) -> is_nonexpansive e

we get:

# let module M = struct let x = ref [] end in M.x;;
- : 'a list ref = {contents = []}

The non-generalizable status has been forgotten. What I'm not sure is 
whether this is only an artefact of the internal representation of 
levels to control generalization, or whether there are some deeper issues.


-- Alain