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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 36751BB84 for ; Mon, 14 Jul 2008 20:04:42 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvMBAD8ye0jIuX5BiGdsb2JhbACSLgEBAQ8gmFU X-IronPort-AV: E=Sophos;i="4.30,360,1212357600"; d="scan'208";a="13104675" Received: from mta18.f3.k8.com.br ([200.185.126.65]) by mail2-smtp-roc.national.inria.fr with ESMTP; 14 Jul 2008 20:04:41 +0200 Received: from localhost (localhost [127.0.0.1]) by smtpa.f3.k8.com.br (Postfix) with ESMTP id 8CF5B28000B5; Mon, 14 Jul 2008 18:04:39 +0000 (GMT) X-Virus-Scanned: amavisd-new at k8.com.br Received: from smtpa.f3.k8.com.br ([127.0.0.1]) by localhost (mta18.f3.k8.com.br [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X1W24hsmPRu1; Mon, 14 Jul 2008 18:04:39 +0000 (GMT) Received: from [10.7.5.105] (fosforo.k8.com.br [200.185.109.125]) by smtpa.f3.k8.com.br (Postfix) with ESMTP id 3560C28000A5; Mon, 14 Jul 2008 18:04:38 +0000 (GMT) Subject: Re: [Caml-list] Mutually recursive types in different modules From: Andre Nathan To: Arthur Chan Cc: Jon Harrop , caml-list@yquem.inria.fr In-Reply-To: <74cabd9e0807141057u64b31518h49627afb30de5503@mail.gmail.com> References: <1216054202.29061.2.camel@andre.mz.digirati.com.br> <200807141804.32640.jon@ffconsultancy.com> <74cabd9e0807141057u64b31518h49627afb30de5503@mail.gmail.com> Content-Type: text/plain Date: Mon, 14 Jul 2008 15:04:46 -0300 Message-Id: <1216058686.29061.11.camel@andre.mz.digirati.com.br> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; recursive:01 achieves:01 recursive:01 parametrized:01 nathan:98 wrote:01 graph:01 graph:01 recursively:01 caml-list:01 modules:02 modules:02 defined:02 functional:02 module:03 On Mon, 2008-07-14 at 10:57 -0700, Arthur Chan wrote: > As Jon demonstrates it is "possible," but I do not think it truly > achieves what you are trying to do. What is your use case? I do not > recommend trying to make types recursive across modules. Even > recursively defined modules have reared their ugly end on me. It is > equivalent to writing non-orthogonal code, in the functional paradigm > (see Pragmatic Programmer). I had a graph type that depended on a vertex type (Vertex.t), which in its turn is a record with a graph field (of type Graph.t). I parametrized the Graph.t type and then used it in the Vertex module as "vertex Graph.t". I guess I have a better design now. Thanks, Andre