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
Inter-module dependences
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-06-15 (15:01)
From: Julien Signoles <Julien.Signoles@l...>
Subject: Re: [Caml-list] Inter-module dependences
Hello,

> module Make_MyGraph(V : MYVERTEX with type edge = E.t)(E : EDGE with
> type vertex = V.t) = struct
>      module V = V
>      module E = E
>      ...
> end
>
> The compiler found an error on "with type edge = E.t" : "Unbound type
> constructor E.t".

Remember: equality is commutative... You should write:

module Make_MyGraph
  (V: MYVERTEX)
  (E: EDGE with type t = V.edge and type vertex = V.t) =
struct
  ...
end

Hope this helps,
Julien
-- 
mailto:Julien.Signoles@lri.fr ; http://www.lri.fr/~signoles
"In theory, practice and theory are the same,
but in practice they are different" (Larry McVoy)