From: brogoff@speakeasy.net
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Functor implementation
Date: Thu, 24 Jul 2003 08:16:11 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.44.0307240806180.29615-100000@grace.speakeasy.net> (raw)
In-Reply-To: <20030723224120.GA10834@pyramid.twistedmatrix.com>
On Wed, 23 Jul 2003, Chris Clearwater wrote:
> Ahh, thanks, functors now fit nicely in my head. And yeah that cmp
> function was kind of braindead. I dont know why I didnt simply write it
> as : let cmp x y = if x > y then GT else if x < y then LT else EQ. But
> it would still be nice if the built in comparison function returned a
> sum type.
I agree. I think I made a petty complaint about this some time ago. And
I'd make another (even more petty) complaint about your choice of constructor
names now, as I'd prefer Equal, LessThan, GreaterThan or Eq, Lt, Gt, so that
all caps names could be reserved by convention for module types and "view"
constructor names. By view constructors, I'm referring to the technique
described by Wang and Murphy for simulating views in ML; that technique is
even better in OCaml with private types, though I suspect that we'd pay more
for the indirections than would MLton users.
> Maybe "ordering" is a more appropriate name. Also, true and false appear
> to be a sum type: type bool = True | False, except you can't have lower
> case constructor names. Does this signal the fact that there is some
> kind of limitation with having primitive sum types?
Nope, probably hysterical raisins again. Note that Revised fixes this.
-- Brian
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
prev parent reply other threads:[~2003-07-24 15:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-23 11:56 Chris Clearwater
2003-07-23 13:01 ` Xavier Leroy
2003-07-23 22:41 ` Chris Clearwater
2003-07-24 15:16 ` brogoff [this message]
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=Pine.LNX.4.44.0307240806180.29615-100000@grace.speakeasy.net \
--to=brogoff@speakeasy.net \
--cc=caml-list@inria.fr \
/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