Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
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