From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id E26C9BBAF for ; Fri, 29 Oct 2010 16:39:08 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AusLANt5ykxii1vMZGdsb2JhbACDC5AfjjIaCgsFESStCDyCF4YmiQUBBAQBgR2DMnQEhFeJBA X-IronPort-AV: E=Sophos;i="4.58,259,1286143200"; d="scan'208";a="76772439" Received: from nm5-vm0.bullet.mail.sp2.yahoo.com ([98.139.91.204]) by mail4-smtp-sop.national.inria.fr with SMTP; 29 Oct 2010 16:39:07 +0200 Received: from [98.139.91.70] by nm5.bullet.mail.sp2.yahoo.com with NNFMP; 29 Oct 2010 14:39:06 -0000 Received: from [98.139.91.53] by tm10.bullet.mail.sp2.yahoo.com with NNFMP; 29 Oct 2010 14:39:06 -0000 Received: from [127.0.0.1] by omp1053.mail.sp2.yahoo.com with NNFMP; 29 Oct 2010 14:39:06 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 646278.33523.bm@omp1053.mail.sp2.yahoo.com Received: (qmail 46368 invoked by uid 60001); 29 Oct 2010 14:32:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1288362739; bh=q571+rUaMVgG/k7+DeH5D1KVAXd8uXZuaWoypRin/ro=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=TWfJiVVBMdy+psUoShCftLZuly12RCkJSL9LpSpqOL/0fsU81FhcyowV2uT4QAzSJByxMsjpHluwW4VHOOz8IxshJR2YdCg5hgrgUPEcEhYL47sXJ6I6kpg5ZK9yJGnEBf8abNHHsmO44TfqGENW3AEcOFylDETM1+os2Rlh3JI= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=tvtsToVM740W75Pi/tVWcXRdIpUF6lU4VD1IDS2pMnpKhTIP4ehC3AsU3DqDurAnHZI8JihLPt35xyWaGs1/cD19aU+W3YeAkOnmOWpc/hq6Evm8nhs7PW2m3kg7vSZqqg8bK1yQu8cx69DFcsu6h3Zkd3+YS88U47dGwy8Y/XE=; Message-ID: <904846.44200.qm@web111513.mail.gq1.yahoo.com> X-YMail-OSG: D2.etU4VM1mDRMGMHbOb7n_RtXCMB2x6Np2oAkh0RIbwTbt Pp.0foQkD0q6whYQEf9Tn1P2xrF2ZOF7298vIlh4fmouQTy09CQphMdOq6_9 EcWWbM.jj4.L1J8HUOZGzAV7VOJpGGK449LT0R0oe_NKv58IKk6s6h_QU4fV aYEVv9AhANd0I6U.Q383J_ZGsb_umsIYVR0cux45aZuoFkfOCY3XdSiWpFy2 L_ZBgMXmBOzNqEZq4F.Cj7EWRLWS.NpQ._U0RUHUOSWl0K_BgYiOy1oPRTbB VG6udUro5ZxpR_Ot6DdrSitB.nvKQAtp_oxhYP7.PtD8bHDs2oFyfuiw- Received: from [213.205.70.223] by web111513.mail.gq1.yahoo.com via HTTP; Fri, 29 Oct 2010 07:32:19 PDT X-Mailer: YahooMailClassic/11.4.9 YahooMailWebService/0.8.107.284920 Date: Fri, 29 Oct 2010 07:32:19 -0700 (PDT) From: Dario Teixeira Subject: Re: [Caml-list] Generalized Algebraic Datatypes To: caml-list , Jacques Le Normand MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; datatypes:01 o'caml:01 compiler:01 o'caml:01 datatypes:01 syntax:01 bool:01 bool:01 syntax:01 constructors:01 haskell:01 ocaml:01 ocaml:01 verbose:01 token:01 Hi,=0A=0A> I am pleased to announce an experimental branch of the O'Caml co= mpiler:=0A> O'Caml extended with Generalized Algebraic Datatypes. You can f= ind more=0A> information on this webpage:=0A=0AI have a couple of questions= regarding the syntax you've chosen for GADT=0Adeclaration. For reference,= let's consider the first example you've provided:=0A=0Atype _ t =3D=0A | = IntLit : int -> int t=0A | BoolLit : bool -> bool t=0A | Pair : 'a t * 'b= t -> ('a * 'b) t=0A | App : ('a -> 'b) t * 'a t -> 'b t=0A | Abs : ('a -= > 'b) -> ('a -> 'b) t =0A=0A=0AThere's something "Haskellish" about this sy= ntax, in the sense that type=0Aconstructors are portrayed as being like fun= ctions. While this does make=0Asense in Haskell, in Ocaml it feels a bit o= ut of place, because you cannot,=0Afor example, partially apply a type cons= tructor.=0A=0AAlso, note that in all the variant declarations the final tok= en is 't'. =0AAre there any circumstances at all where a GADT constructor = will not end=0Aby referencing the type being defined? If there are not, th= en this syntax=0Aimposes some syntactic salt into the GADT declaration.=0A= =0AI know this is not the sole syntax that was considered for GADTs in Ocam= l.=0AXavier Leroy's presentation in CUG 2008 shows a different one, which e= ven=0Athough slightly more verbose, does have the advantage of being more "= Camlish".=0AIs there any shortcoming to the 2008 syntax that resulted in it= being dropped=0Ain favour of this new one?=0A=0ABest regards,=0ADario Teix= eira=0A=0A=0A=0A