From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 4581DBBAF for ; Tue, 6 Oct 2009 14:46:57 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8BAJrZykpRZ90xkWdsb2JhbACadwEBAQEJCwoHEwO3doQqBIFT X-IronPort-AV: E=Sophos;i="4.44,513,1249250400"; d="scan'208";a="37657512" Received: from mtaout03-winn.ispmail.ntl.com ([81.103.221.49]) by mail1-smtp-roc.national.inria.fr with ESMTP; 06 Oct 2009 14:46:57 +0200 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091006124656.TOKC17277.mtaout03-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Tue, 6 Oct 2009 13:46:56 +0100 Received: from romulus.metastack.com ([81.102.132.77]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20091006124656.PVUF22934.aamtaout04-winn.ispmail.ntl.com@romulus.metastack.com>; Tue, 6 Oct 2009 13:46:56 +0100 Received: from Tenor ([172.16.0.8]) (authenticated bits=0) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id n96CkqeR023685 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 6 Oct 2009 13:46:53 +0100 From: "David Allsopp" To: "'Chantal KELLER'" , "'caml-list'" References: <4ACB319A.1080608@wanadoo.fr> <003901ca4682$d47f8460$7d7e8d20$@metastack.com> In-Reply-To: <003901ca4682$d47f8460$7d7e8d20$@metastack.com> Subject: RE: [Caml-list] Constructors are not functions Date: Tue, 6 Oct 2009 13:46:52 +0100 Message-ID: <003a01ca4683$14a813e0$3df83ba0$@metastack.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcpGfMUXt+JlJwj0Sw+GG/w0q0M9lwABLu+AAABdHGA= Content-Language: en-gb Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 81.102.132.77 X-Cloudmark-Analysis: v=1.0 c=1 a=Mv2A4AzjtYwA:10 a=ZOzjf2MOAAAA:8 a=I_D0moTXAiGH-XWRdbIA:9 a=nQrngoXSd1DZ0GVtHItoWOiTmcsA:4 X-Spam: no; 0.00; constructors:01 constructors:01 simulate:01 ocaml:01 camlp:01 foo:01 sml:01 sml:01 unbound:01 wrote:01 partial:01 caml-list:01 functions:01 functions:01 constructor:01 David Allsopp wrote: > > Is there a reason for constructors not to behave like functions? > > For instance, one cannot make a partial application from a constructor: > > This is how SML handles constructors, Xavier explained the reasons he > chose to depart from this in: > > http://caml.inria.fr/pub/ml-archives/caml- > list/2001/08/47db53a4b42529708647c9e81183598b.en.html > > I think it would be possible to simulate the SML behaviour in OCaml > using camlp4 (if you assume that for [type foo = Bar of int] that > future unbound references to [bar] are interpreted as [fun x -> bar x] > instead of an error) Tsk - [fun x -> bar x] should of course be [fun x -> Bar x]