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
module types and constraints in several layers
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-15 (14:48)
From: Chris King <colanderman@g...>
Subject: Re: [Caml-list] module types and constraints in several layers
On 3/15/07, Christian Sternagel <christian.sternagel@uibk.ac.at> wrote:
> some.ml:
> module Make (Trs : TRS.T) : SOME.T = struct

This looks to be your problem... by specifying the type of Trs as
TRS.T, you are losing the information about the relation between the
types in the modules.  You can fix this by adding this relation to the
definition of TRS.T:

module type T = sig
 type t
 module Term: TERM.T
 module Fun : FUNCTION.T with type t = Term.Fun.t
 val f0 : t -> Fun.t Setx.set
end

Otherwise O'Caml presumes Term and Fun to be completely unrelated.

Hope this helps; module type constraints can get messy :)