From: Goswin von Brederlow <goswin-v-b@web.de>
To: "David Allsopp" <dra-news@metastack.com>
Cc: <goswin-v-b@web.de>, "'Jon Harrop'" <jon@ffconsultancy.com>,
<caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Constructors are not functions
Date: Sat, 10 Oct 2009 08:16:57 +0200 [thread overview]
Message-ID: <87zl7z22p2.fsf@frosties.localdomain> (raw)
In-Reply-To: <003501ca48a9$dfdf80c0$9f9e8240$@metastack.com> (David Allsopp's message of "Fri, 9 Oct 2009 07:29:34 +0100")
"David Allsopp" <dra-news@metastack.com> writes:
> Goswin von Brederlow wrote:
> <snip>
>> 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
next prev parent reply other threads:[~2009-10-10 6:25 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 12:01 Chantal KELLER
2009-10-06 12:19 ` [Caml-list] " Philippe Wang
2009-10-06 12:38 ` Jon Harrop
2009-10-06 13:38 ` Richard Jones
2009-10-10 11:49 ` blue storm
2009-10-06 12:45 ` David Allsopp
2009-10-06 12:46 ` David Allsopp
2009-10-06 13:14 ` Jim Farrand
2009-10-06 13:51 ` Michel Mauny
2009-10-06 13:15 ` Jon Harrop
2009-10-06 14:04 ` David Allsopp
2009-10-06 14:51 ` Jon Harrop
2009-10-06 15:24 ` Richard Jones
2009-10-06 16:31 ` Jacques Garrigue
2009-10-08 12:37 ` Goswin von Brederlow
2009-10-09 6:29 ` David Allsopp
2009-10-10 6:16 ` Goswin von Brederlow [this message]
2009-10-06 13:18 ` Gerd Stolpmann
2009-10-06 15:50 ` Jérémie Dimino
2009-10-06 21:55 ` blue storm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zl7z22p2.fsf@frosties.localdomain \
--to=goswin-v-b@web.de \
--cc=caml-list@yquem.inria.fr \
--cc=dra-news@metastack.com \
--cc=jon@ffconsultancy.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox