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 C3B96BC57 for ; Thu, 29 Apr 2010 19:45:47 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcDAD9i2UvZSMDqaGdsb2JhbACdDxUNCwMHBxEDH71ihRAE X-IronPort-AV: E=Sophos;i="4.52,296,1270418400"; d="scan'208";a="49524617" Received: from fmmailgate03.web.de ([217.72.192.234]) by mail3-smtp-sop.national.inria.fr with ESMTP; 29 Apr 2010 19:45:47 +0200 Received: from smtp06.web.de ( [172.20.5.172]) by fmmailgate03.web.de (Postfix) with ESMTP id CAE3614EF27E9; Thu, 29 Apr 2010 19:45:46 +0200 (CEST) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1O7Xo2-0000J1-00; Thu, 29 Apr 2010 19:45:46 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.71) (envelope-from ) id 1O7Xo3-0006Me-Ue; Thu, 29 Apr 2010 19:45:48 +0200 From: Goswin von Brederlow To: Dennis Walter Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Nested modules with equal types References: Date: Thu, 29 Apr 2010 19:45:47 +0200 In-Reply-To: (Dennis Walter's message of "Thu, 29 Apr 2010 19:20:48 +0200") Message-ID: <87d3xikv90.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX19NlApCOK27r5O4RykGBaRnYmQ3AxfA0Snuc2Uq Cbd1Nx9jQusPfBBseBrL3x/u+DVSeAFRPFWLhx8cf3g0Q4x9SN zkAqFS5Ao= X-Spam: no; 0.00; ocaml:01 sig:01 abbreviation:01 struct:01 mfg:98 caml-list:01 cyclic:01 writes:01 define:02 define:02 modules:02 modules:02 defined:02 module:03 module:03 Dennis Walter writes: > Hi, > > is there a way in OCaml to define nested modules where a type t of the > inner module is defined as equal to the out type of the same name? > > For example, I would like to define a file outer.ml containing > > type t > module Inner : > sig > type t = t > end > > but I get the error > Error: The type abbreviation t is cyclic > which kind of makes sense. Can I somehow refer to Outer.t in the Inner > module? (Outer.t does in fact not work either). > > Thanks! type t module Inner = struct type tmp = t type t = tmp end MfG Goswin