From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA08504; Thu, 24 Jul 2003 17:16:16 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA14128 for ; Thu, 24 Jul 2003 17:16:14 +0200 (MET DST) Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6OFGDf11365 for ; Thu, 24 Jul 2003 17:16:13 +0200 (MET DST) Received: (qmail 11914 invoked from network); 24 Jul 2003 15:16:11 -0000 Received: from unknown (HELO grace.speakeasy.org) ([216.254.0.2]) (envelope-sender ) by mail15.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 24 Jul 2003 15:16:11 -0000 Date: Thu, 24 Jul 2003 08:16:11 -0700 (PDT) From: brogoff@speakeasy.net To: "caml-list@inria.fr" Subject: Re: [Caml-list] Functor implementation In-Reply-To: <20030723224120.GA10834@pyramid.twistedmatrix.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; brogoff:01 caml-list:01 functor:01 ahh:01 functors:01 petty:01 simulating:01 indirections:01 mlton:01 raisins:01 chris:01 bool:01 ocaml:01 speakeasy:01 constructors:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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