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=none autolearn=disabled version=3.1.3 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 728E5BBAF for ; Sat, 10 Oct 2009 08:25:27 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar0CAJrFz0rZSMDji2dsb2JhbACBUZk7AQEBCgsKBxEFvXGELQQ X-IronPort-AV: E=Sophos;i="4.44,536,1249250400"; d="scan'208";a="34639092" Received: from fmmailgate02.web.de ([217.72.192.227]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Oct 2009 08:25:27 +0200 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate02.web.de (Postfix) with ESMTP id C4DAC12C605A1; Sat, 10 Oct 2009 08:16:58 +0200 (CEST) Received: from [95.208.117.111] (helo=frosties.localdomain) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #314) id 1MwVGE-00012k-00; Sat, 10 Oct 2009 08:16:58 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.69) (envelope-from ) id 1MwVGD-00065U-V7; Sat, 10 Oct 2009 08:16:57 +0200 From: Goswin von Brederlow To: "David Allsopp" Cc: , "'Jon Harrop'" , Subject: Re: [Caml-list] Constructors are not functions References: <4ACB319A.1080608@wanadoo.fr> <003901ca4682$d47f8460$7d7e8d20$@metastack.com> <200910061415.48065.jon@ffconsultancy.com> <005501ca468d$dc9b51a0$95d1f4e0$@metastack.com> <87ljjmxdsc.fsf@frosties.localdomain> <003501ca48a9$dfdf80c0$9f9e8240$@metastack.com> Date: Sat, 10 Oct 2009 08:16:57 +0200 In-Reply-To: <003501ca48a9$dfdf80c0$9f9e8240$@metastack.com> (David Allsopp's message of "Fri, 9 Oct 2009 07:29:34 +0100") Message-ID: <87zl7z22p2.fsf@frosties.localdomain> User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.22 (linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1/9xcK3tDGjWi8hUjSbyJcuQ7VM4Xu1rMkNc1+Y KrT1ixJJxZx8C0w2NB5z5RqUjp2P06yrbjq9okb170YWBUOY46 +nqIo+AS4= X-Spam: no; 0.00; constructors:01 foo:01 constructors:01 arbitrarily:01 ocaml:01 syntax:01 mfg:98 wrote:01 caml-list:01 functions:01 functions:01 constructor:01 int:01 int:01 writes:01 "David Allsopp" writes: > Goswin von Brederlow wrote: > >> Then what about >> >> type t1 = Bar of int * int >> type t2 = Foo of (int * int) >> >> If you treat constructors as functions taking one argument then > > But why (so arbitrarily) do this? Because that was what the mentioned material said. >> t1: int * int -> t1 >> t2: int * int -> t2 > > If you look at each type definition and choose those most appropriate, then: > > t1: int -> int -> t1 > t2: int * int -> t2 > > I don't see your point (but this is pre-coffee!)? The fact that you write > [Bar(1, 2)] for a two-constructor variant tag and [bar 1 2] for a "2 > argument" function is just an (occasionally irritating) oddity of the OCaml > syntax - it wouldn't have to affect any derived constructor functions here. Actualy you do see my point. My point was that the appropriate type should be used. > However, the impracticality of importing the types from other interfaces > (see Richard Jones post in this thread) has already revealed that this > couldn't be done transparently in the way I'd initially thought so it's > become a bit of a thought experiment anyway :o) > > > David MfG Goswin