caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Fernando Alegre <fernando@cc.gatech.edu>
Cc: Christophe TROESTLER <Christophe.Troestler@umh.ac.be>,
	caml-list@inria.fr
Subject: Re: [Caml-list] Equality of functional values
Date: Wed, 31 Jan 2007 10:13:42 +1100	[thread overview]
Message-ID: <1170198822.6391.110.camel@rosella.wigram> (raw)
In-Reply-To: <20070130220557.GD15659@gaia.cc.gatech.edu>

On Tue, 2007-01-30 at 17:05 -0500, Fernando Alegre wrote:

> There are two separate notions of equality mixed together.
> My point is, should "OCaml polymorphic equality" be the
> same concept at "IEEE equality"?

No, this is not possible. x <> x is the IEEE test for a NaN,
and cannot possibly be used in a structural equality
test which is primarily required for inserting data into
containers: you'd have a Set in which after inserting
a value the value wasn't in the Set!


> Why not wish for three separate operators (=,== and =.)?

What about abstract types?

The bottom line is: you can always write your own comparison
functions and use them with modular functors (extensionally
polymorphic), you can't get a single coherent intensionally
polymorphic equality concept because programs are always using
representations of value rather than the mathematical values.

It is a pity we don't have G'Caml around: it may provide
a convenient way to mix user defined equality with
Ocaml's run time driven polymorphic structural equality.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2007-01-30 23:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29 21:04 Simon Frost
2007-01-29 21:11 ` [Caml-list] " Tom
2007-01-29 21:23   ` Brian Hurt
2007-01-29 21:59 ` Gerd Stolpmann
2007-01-30  8:17   ` Christophe Raffalli
2007-01-30  8:45   ` David MENTRE
2007-01-30 13:24 ` Andrej Bauer
2007-01-30 13:55   ` skaller
2007-01-30 14:21     ` Brian Hurt
2007-01-30 15:21     ` Jeff Polakow
2007-01-30 15:49       ` Jacques Carette
2007-01-30 17:23         ` Chris King
2007-01-30 20:18           ` Tom
2007-01-30 20:30             ` Gerd Stolpmann
2007-01-30 20:41               ` Fernando Alegre
2007-01-30 21:01                 ` Christophe TROESTLER
2007-01-30 21:08                   ` Tom
2007-01-30 21:46                     ` Christophe TROESTLER
2007-01-30 22:05                       ` Fernando Alegre
2007-01-30 23:13                         ` skaller [this message]
2007-01-30 23:06     ` Andrej Bauer
2007-01-31  0:15       ` Jacques Carette
2007-01-31  7:03         ` Stefan Monnier
2007-01-31 12:54           ` [Caml-list] " Jacques Carette
2007-01-31  0:15       ` [Caml-list] " skaller

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=1170198822.6391.110.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=Christophe.Troestler@umh.ac.be \
    --cc=caml-list@inria.fr \
    --cc=fernando@cc.gatech.edu \
    /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;
as well as URLs for NNTP newsgroup(s).