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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 21D79BC57 for ; Sun, 31 Oct 2010 15:35:59 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArMEAK8bzUxQW+UMgWdsb2JhbACTTY18FQEBFiIiukCFRASKVIV0 X-IronPort-AV: E=Sophos;i="4.58,268,1286143200"; d="scan'208";a="77457222" Received: from lo.gmane.org ([80.91.229.12]) by mail2-smtp-roc.national.inria.fr with ESMTP; 31 Oct 2010 15:35:58 +0100 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PCZ0m-0005A7-Vd for caml-list@inria.fr; Sun, 31 Oct 2010 15:35:56 +0100 Received: from avelizy-155-1-73-128.w90-2.abo.wanadoo.fr ([90.2.24.128]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Oct 2010 15:35:56 +0100 Received: from sylvain by avelizy-155-1-73-128.w90-2.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Oct 2010 15:35:56 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: Generalized Algebraic Datatypes Date: Sun, 31 Oct 2010 14:35:43 +0000 (UTC) Message-ID: References: <904846.44200.qm@web111513.mail.gq1.yahoo.com> <87tyk2v46e.fsf@gmail.com> X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: avelizy-155-1-73-128.w90-2.abo.wanadoo.fr User-Agent: slrn/pre1.0.0-18 (Linux) X-Spam: no; 0.00; le-gall:01 datatypes:01 datatype:01 camlp:01 camlp:01 constructors:01 capitalized:01 wrote:01 constructor:01 constructor:01 int:01 int:01 writes:01 caml:02 caml:02 On 31-10-2010, Wojciech Daniel Meyer wrote: > bluestorm writes: > >> It was actually the case in Caml Light : each datatype constructor >> implicitly declared a constructor function with the same name. I >> don't exactly know why this feature was dropped in Objective Caml, >> but I think I remember (from a previous discussion) that people >> weren't sure it was worth the additional complexity. > > Would that be not possible now with Camlp4 extension? > I am pretty sure, it is possible to implement them with camlp4. Just a matter of time -- and motivation. The only limitation I can see, is that the generated constructors won't be capitalized. E.g.: type t = MyConstr | YourConstr of int => type t = MyConstr | YourConstr of int let myConstr = MyConstr let yourConstr i = YouConstr i Regards, Sylvain Le Gall