From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 50ACEBC57 for ; Sat, 4 Dec 2010 20:39:48 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvMUAFso+kw+BBFqWmdsb2JhbACQX5JaARYICwgCEAMfvnGFSQSFN4s8 X-IronPort-AV: E=Sophos;i="4.59,299,1288566000"; d="scan'208";a="91267909" Received: from smtp-106-saturday.noc.nerim.net (HELO mallaury.nerim.net) ([62.4.17.106]) by mail1-smtp-roc.national.inria.fr with ESMTP; 04 Dec 2010 20:39:36 +0100 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by mallaury.nerim.net (Postfix) with ESMTPS id 6AA99153415; Sat, 4 Dec 2010 20:39:36 +0100 (CET) Received: from glinka.lesours ([192.168.0.1]) by hector.lesours with smtp (Exim 4.72) (envelope-from ) id 1POxxH-0005WH-JS; Sat, 04 Dec 2010 20:39:35 +0100 Date: Sat, 4 Dec 2010 20:39:34 +0100 From: Basile Starynkevitch To: Jacques Le Normand Cc: caml-list caml-list Subject: Re: [Caml-list] GADT constructor syntax Message-Id: <20101204203934.ff698fa9.basile@starynkevitch.net> In-Reply-To: References: X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; basile:01 basile:01 syntax:01 syntax:01 constructors:01 ocaml:01 bool:01 bool:01 syntaxes:01 ocamlyacc:01 parser:01 syntaxes:01 cheers:01 faiencerie:01 92340:01 On Sat, 4 Dec 2010 14:25:01 -0500 Jacques Le Normand wrote: > Dear caml-list, > I would like to start a constructive discussion on the syntax of GADT > constructors of the ocaml gadt branch, which can be found at: > > https://sites.google.com/site/ocamlgadt/ > > There are two separate issues: > > 1) general constructor form > > option a) > > type _ t = > TrueLit : bool t > | IntLit of int : int lit > > option b) > > type _ t = > TrueLit : bool t > | IntLit : int -> int lit > I would believe that we need more examples to choose the most readable or natural syntax. Because both options have their valid point. Maybe you might 1. provide a more convincing example, e.g. a 20 lines tutorial example, and give it in both syntaxes. This let people choose really... 2. choose one syntax for the ocamlyacc (or menhir) based parser, and provide an Ocamlp4 (or is it Ocamlp5) extension for the other syntax. 3. support both syntaxes at once, and have the user choose what fits him best. Cheers. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mine, sont seulement les miennes} ***