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 (15:06)
From: Hugo Ferreira <hmf@i...>
Subject: Re: [Caml-list] Shared types: dependency in modules with polymorphic type
Andreas Rossberg wrote:
> 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 functor.

I agree. I finally had to go that route.
However that means I have to change my modules.
This is taking some time to do. I was
hoping to avoid such reworking.

Hugo F.

> - Andreas
> ------------------------------------------------------------------------
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs