From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id F40EFBCD3 for ; Sat, 24 May 2008 01:30:50 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am8DABrwNkhQDPJgZGdsb2JhbACBVZBXGgMEBAcQBpYyhXU X-IronPort-AV: E=Sophos;i="4.27,532,1204498800"; d="scan'208";a="12979011" Received: from smtp27.orange.fr ([80.12.242.96]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 May 2008 01:30:50 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2723.orange.fr (SMTP Server) with ESMTP id 3357C1C00086 for ; Sat, 24 May 2008 01:30:50 +0200 (CEST) Received: from localhost.localdomain (Mix-Lyon-109-2-148.w193-250.abo.wanadoo.fr [193.250.19.148]) by mwinf2723.orange.fr (SMTP Server) with ESMTP id 451B61C00085 for ; Sat, 24 May 2008 01:30:49 +0200 (CEST) X-ME-UUID: 20080523233049283.451B61C00085@mwinf2723.orange.fr Date: Fri, 23 May 2008 23:37:28 +0200 From: Fabrice Marchant To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] A functor to produce recursive modules ? Message-ID: <20080523233728.11c69320@orange.fr> In-Reply-To: <4837444A.4020303@ed.ac.uk> References: <20080522225830.52208601@orange.fr> <483661D2.9040301@frisch.fr> <20080523214205.769b7788@orange.fr> <4837444A.4020303@ed.ac.uk> X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.9; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; functor:01 recursive:01 recursive:01 orderedtype:01 struct:01 sig:01 sig:01 elt:01 elt:01 val:01 struct:01 ocaml:01 bug:01 48,:98 wrote:01 On Fri, 23 May 2008 23:25:14 +0100 Jeremy Yallop wrote: > Fabrice Marchant wrote: > > However, even if the method is clear, I run into problems trying to > > apply it on these 2 recursive modules : map to sets and a set of map > > to sets. > > This doesn't appear to require recursive modules, since ModSet is not > used within Mod. Except for the missing "compare" (in your version), > it's equivalent to the following: > > module F ( X : Set.OrderedType ) = struct > module Mod : sig > module XSet : > sig > type elt = X.t > type t = Set.Make( X ).t > end > > module XMap : > sig > type key = X.t > type 'a t = 'a Map.Make( X ).t > end > > type elt = X.t > type t = XSet.t XMap.t > val compare : t -> t -> int > end = > struct > module XSet = Set.Make( X ) > module XMap = Map.Make( X ) > > type elt = X.t > type t = XSet.t XMap.t > let compare = XMap.compare XSet.compare > end > module ModSet : Set.S with type elt = Mod.t = Set.Make( Mod ) > end > > Got this internal message from ocaml 3.10.1 : "Fatal error: exception > > Assert_failure("typing/path.ml", 48, 22)" > > I agree with Till that you should report this bug. > > Jeremy. > Hi ! You're right. But about the lack of "compare" and use of ModSet within Mod : I just ditched the code that was unnecessary to exhibit the naughty message. Regards, Fabrice