caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Elnatan Reisner" <elnatan@cs.umd.edu>
To: caml-list@yquem.inria.fr
Subject: Physical counterpart to Pervasives.compare?
Date: Tue, 28 Jul 2009 21:25:37 -0400 (EDT)	[thread overview]
Message-ID: <1501.208.59.169.96.1248830737.squirrel@webmail.cs.umd.edu> (raw)

Is there something that can complete this analogy:
(=) is to (==) as Pervasives.compare is to ___?

That is, is there a polymorphic total ordering with respect to *physical*
entities, rather than to their structure?

I'm afraid of getting into trouble with Obj.magic, but what would this do:
let f (x:'a) (y:'a) = compare (Obj.magic x) (Obj.magic y)
? Or would annotations make any difference:
let f (x:'a) (y:'a) = compare (Obj.magic x : int) (Obj.magic y : int)

-Elnatan


             reply	other threads:[~2009-07-29  1:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-29  1:25 Elnatan Reisner [this message]
2009-07-29  3:06 ` [Caml-list] " Edgar Friendly
2009-07-29  3:58   ` Edgar Friendly
2009-07-29  6:13 ` Alain Frisch
     [not found] <20090826100004.0169CBC58@yquem.inria.fr>
2009-08-26 10:14 ` Pascal Cuoq

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=1501.208.59.169.96.1248830737.squirrel@webmail.cs.umd.edu \
    --to=elnatan@cs.umd.edu \
    --cc=caml-list@yquem.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;
as well as URLs for NNTP newsgroup(s).