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
Shared types: dependency in modules with polymorphic type
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-05-14 (14:42)
From: Andreas Rossberg <rossberg@m...>
Subject: Re: [Caml-list] Shared types: dependency in modules with polymorphic type
On May 14, 2009, at 09.58 h, Hugo Ferreira wrote:
>>> My question is: is their any way I may organize the modules or
>>> indicate shared types in order to use a (very extensive) VB
>>> interface (Or VB1 module)? Specifically how do I enforce the
>>> shared type:
>>> U1.instance VB1.t = U1.t = Make_U(VB1).t
>> First, try the above.  It may help.  If it does not, then you will  
>> need to add explicit sharing constraints.  But which sharing  
>> constraints are *really* needed will be the ones revealed by first  
>> removing the type annotations you currently have.
> Worked correctly. However I need only remove the U in Make_U : U and
> change it to a simple Make_U. "U1.t" now becomes visible and binds
> correctly.

FWIW, the "proper" solution is not to drop the annotation, but to  
refine it to "U with type t = int Vb.t" in the definition of the  

- Andreas