From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p0K9X39a010282 for ; Thu, 20 Jan 2011 10:33:03 +0100 X-IronPort-AV: E=Sophos;i="4.60,350,1291590000"; d="scan'208";a="73523703" Received: from unknown (HELO [192.168.1.105]) ([132.227.100.174]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA; 20 Jan 2011 10:32:58 +0100 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1082) From: Damien Doligez In-Reply-To: <30712448.post@talk.nabble.com> Date: Thu, 20 Jan 2011 10:32:58 +0100 Message-Id: <1CA28CEB-4802-4F52-8C7F-686AB31B9E23@inria.fr> References: <30712448.post@talk.nabble.com> To: caml users X-Mailer: Apple Mail (2.1082) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p0K9X39a010282 Subject: [Caml-list] Re: recursive type definition camllight On 2011-01-19, at 19:10, sieira wrote: > type form == textbox list * (form,customer list -> customer list);; > > This form displays some textboxes (using graphics library) on which the user > types the necessary data, after that, it is parsed and tailed to the > returned customer list. It is necessary that the function that does this > takes the form as a parameter. żIs this possible? You cannot define a recursive type abbreviation in Caml Light. But you can define a recursive concrete type: type form = Form of textbox list * (form -> customer list -> customer list);; This will make your code a bit more cumbersome (you'll have to add the Form constructor in many places), but it should work. -- Damien