Version française
Home     About     Download     Resources     Contact us    
Browse thread
GADT constructor syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Basile Starynkevitch <basile@s...>
Subject: Re: [Caml-list] GADT constructor syntax
On Sat, 4 Dec 2010 14:25:01 -0500
Jacques Le Normand <rathereasy@gmail.com> 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: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***