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.4 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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 1ADF5BB84 for ; Fri, 23 May 2008 00:52:17 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlwDAHiWNUjAXQIniGdsb2JhbACBVYl6gViFEAEBAQ8gl3qGJA X-IronPort-AV: E=Sophos;i="4.27,526,1204498800"; d="scan'208";a="26527349" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 23 May 2008 00:51:56 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m4MMprEr021685 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 23 May 2008 00:51:56 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhsDAPCVNUhQDPISb2dsb2JhbACBVYl6gViFEAEMBQIEBxMDl3OGJA X-IronPort-AV: E=Sophos;i="4.27,526,1204498800"; d="scan'208";a="12596304" Received: from smtp19.orange.fr ([80.12.242.18]) by mail1-smtp-roc.national.inria.fr with ESMTP; 23 May 2008 00:51:56 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1918.orange.fr (SMTP Server) with ESMTP id C53FD1C00086 for ; Fri, 23 May 2008 00:51:55 +0200 (CEST) Received: from localhost.localdomain (Mix-Lyon-109-1-222.w193-250.abo.wanadoo.fr [193.250.9.222]) by mwinf1918.orange.fr (SMTP Server) with ESMTP id 9B8D71C00085 for ; Fri, 23 May 2008 00:51:54 +0200 (CEST) X-ME-UUID: 20080522225154637.9B8D71C00085@mwinf1918.orange.fr Date: Thu, 22 May 2008 22:58:30 +0200 From: Fabrice Marchant To: caml-list Subject: A functor to produce recursive modules ? Message-ID: <20080522225830.52208601@orange.fr> 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-Miltered: at concorde with ID 4835F909.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; functor:01 recursive:01 recursive:01 parametrized:01 orderedtype:01 functors:01 functor:01 orderedtype:01 graph:01 graph:01 loops:02 define:02 define:02 modules:02 modules:02 Hi ! Apologize. This topic isnt't exactly at its right place : belongs to Beginners-list. However no answer about this question there and so much clever people here, a denser traffic... Please how to define recursive modules that are parametrized by an OrderedType ? Say these modules types are Mod and ModSet. (Because a function f in module Mod uses a Set of Mod) The problem is I need recursive functors that returns 2 modules. Waiting for a solution, I bypass the problem in defining a non-recursive functor Mod.Make and a Mod function f that returns a Mod List instead of the wanted Mod Set. module StringMod = Mod.Make ( String ) Of course it's then possible to convert the StringMod List to a StringMod Set but a cleaner work would be to write this a single time a general way inside the functor Mod.Make... Here is an example : http://fabrice.marchant.free.fr/graph/example/ The module 'digraph' holds a Make functor that produces an oriented graph of any OrderedType. The function 'search_loops' returns a list of the loops:Digraph found in the Digraph. Please how to change things to return a _ Set _ of Digraphs instead ? The manual explains how to define simple recursive modules, but I do not see the way to perform this with parametred modules. Any light ? Fabrice