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 37A52BC57 for ; Sun, 31 Oct 2010 15:50:16 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhsBADMfzUzRVdQ2i2dsb2JhbAChQQgVAQEBCgsKBw8FH6AkiVqCF4UwLohXAQEDBYU/BIpUhXQ X-IronPort-AV: E=Sophos;i="4.58,268,1286143200"; d="scan'208";a="77457471" Received: from mail-vw0-f54.google.com ([209.85.212.54]) by mail2-smtp-roc.national.inria.fr with ESMTP; 31 Oct 2010 15:50:15 +0100 Received: by vws12 with SMTP id 12so2437430vws.27 for ; Sun, 31 Oct 2010 07:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=jaAs1gaeGX61Oa0/na4VzWC3zlKwKGPGVmMKgsqtOSk=; b=tcfXymkkk5eXIZ4lQ93sEXk4hYogvAHHLYKcXiXmNcfqZpur8/fGnV27R4VLa6cCx6 lyHYmHdrFiH0a8+eCtTxZY5RyacxHk2qCsQwhdDPJnpYtEkFtnPzgXNC3jbKiYJTcA0Z 5UbORfPc6yVNcaE8nxP/hgUDDQxJY8c2XoZVY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=GYAFwkmSWCe2xC+vcZQaBntcX2mOg2FxTAHkI+4CuQzeTLWSRDbT1ZYNF85gsgFbvf ZfPIc/sIRoa3cnc7ojvlLF8KO1+O3ZUdPfwe/TgJ5vHVn+HyCVx03B7hNPzb/UC+kLk5 JorQyDyxcM31iE/pyQLN7ycpBRToS4FaWSNXU= Received: by 10.224.177.210 with SMTP id bj18mr6972488qab.372.1288536615263; Sun, 31 Oct 2010 07:50:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.230.145 with HTTP; Sun, 31 Oct 2010 07:49:53 -0700 (PDT) In-Reply-To: References: <904846.44200.qm@web111513.mail.gq1.yahoo.com> <87tyk2v46e.fsf@gmail.com> From: Lukasz Stafiniak Date: Sun, 31 Oct 2010 15:49:53 +0100 Message-ID: Subject: Re: [Caml-list] Re: Generalized Algebraic Datatypes To: Sylvain Le Gall Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; lukasz:01 datatypes:01 le-gall:01 datatype:01 camlp:01 camlp:01 constructors:01 capitalized:01 capitalized:01 wrote:01 wrote:01 caml-list:01 constructor:01 constructor:01 int:01 On Sun, Oct 31, 2010 at 3:35 PM, Sylvain Le Gall wrote: > 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 > Why do you say so? HOL Light uses capitalized identifiers for values, for example. It's probably possible to do whatever one reasonably wants.