From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 6725FBB91 for ; Sat, 29 Jan 2005 18:13:03 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0THD3Jv020775 for ; Sat, 29 Jan 2005 18:13:03 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA15476 for ; Sat, 29 Jan 2005 18:13:02 +0100 (MET) Received: from mail28.sea5.speakeasy.net (mail28.sea5.speakeasy.net [69.17.117.30]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0THD0wZ020770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 29 Jan 2005 18:13:01 +0100 Received: (qmail 28358 invoked from network); 29 Jan 2005 17:12:59 -0000 Received: from shell3.sea5.speakeasy.net ([69.17.116.4]) (envelope-sender ) by mail28.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Jan 2005 17:12:59 -0000 Date: Sat, 29 Jan 2005 09:12:59 -0800 (PST) From: brogoff To: caml-list Subject: Re: [Caml-list] cyclic types In-Reply-To: <6b8a914205012905427c79cd85@mail.gmail.com> Message-ID: References: <7f8e92aa0501290415321a8e46@mail.gmail.com> <6b8a914205012905427c79cd85@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 41FBC41F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41FBC41C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 wrote:01 wrote:01 abbreviation:01 -rectypes:01 ocaml:01 compiler:01 toplevel:01 -rectypes:01 speakeasy:01 typing:01 cyclic:01 cyclic:01 remi:01 vanicat:02 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Sat, 29 Jan 2005, Remi Vanicat wrote: > On Sat, 29 Jan 2005 14:15:43 +0200, Radu Grigore wrote: > > Why are cyclic types forbidden? > > > > I was forced to use the definition: > > type forest = Forest of forest StringMap.t | Empty > > where I would have rather used > > type forest = forest StringMap.t > > The error is: > > The type abbreviation tree is cyclic > > You can use the -rectypes of the ocaml compiler or toplevel to allow > cyclic type. This comes up relatively frequently, and it is known that having -rectypes as the default is not a good idea. However, wouldn't explicit typing of this case sidestep the known problems and eliminate the need for a -rectypes option here? -- Brian