From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1A4A9BBAF for ; Sat, 12 Jul 2008 01:15:07 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJCGd0jAXQIn/2dsb2JhbACqYw X-IronPort-AV: E=Sophos;i="4.30,348,1212357600"; d="scan'208";a="15042644" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 12 Jul 2008 01:15:06 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m6BNF4N2017638 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 12 Jul 2008 01:15:06 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArACANuFd0hQW+UCgWdsb2JhbACSJgEBECAEmAk X-IronPort-AV: E=Sophos;i="4.30,348,1212357600"; d="scan'208";a="27253088" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 12 Jul 2008 01:15:04 +0200 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1KHRpO-0003ew-JP for caml-list@inria.fr; Fri, 11 Jul 2008 23:15:02 +0000 Received: from ivr94-8-88-162-26-239.fbx.proxad.net ([88.162.26.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 11 Jul 2008 23:15:02 +0000 Received: from zheng_li by ivr94-8-88-162-26-239.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 11 Jul 2008 23:15:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Zheng Li Subject: Re: Troublesome nodes Date: Sat, 12 Jul 2008 01:11:23 +0200 Message-ID: References: <845241.60615.qm@web54607.mail.re2.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ivr94-8-88-162-26-239.fbx.proxad.net User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: <845241.60615.qm@web54607.mail.re2.yahoo.com> Sender: news X-Miltered: at concorde with ID 4877E978.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; nodes:01 seq:01 node:01 node:01 seq:01 recursive:01 sourceforge:01 wrote:01 ideally:01 constructor:01 define:02 defined:02 string:02 string:02 fails:05 Hi, Dario Teixeira wrote: > Ideally, one could do something like this: > > type seq_t = super_node_t list > and nonlink_node_t = > [ `Text of string > | `Bold of seq_t ] > and link_node_t = > [ Mref of string * nonlink_node_t list > | See of string ] > and super_node_t = [nonlink_node_t | link_node_t] > > > However, this fails with an error "The type constructor nonlink_node_t is > not yet completely defined". Jon Harrop suggested untying the recursive > knot, but the solution has a few drawbacks of its own [2]. How about just define type seq_t = super_node_t list and nonlink_node_t = [ `Text of string | `Bold of seq_t ] and link_node_t = [ `Mref of string * nonlink_node_t list | `See of string ] and super_node_t = [`Test of string |`Bold of seq_t | `Mref of string * nonlink_node_t list | `See of string] or similar ... not sure whether this satisfies your requirements though. -- Zheng