caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
[parent not found: <20090729030710.BB3C6BC5C@yquem.inria.fr>]
* Physical counterpart to Pervasives.compare?
@ 2009-07-29  1:25 Elnatan Reisner
  2009-07-29  3:06 ` [Caml-list] " Edgar Friendly
  2009-07-29  6:13 ` Alain Frisch
  0 siblings, 2 replies; 8+ messages in thread
From: Elnatan Reisner @ 2009-07-29  1:25 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-08-26 10:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20090824100004.6DBBDBBAF@yquem.inria.fr>
2009-08-24 12:30 ` [Caml-list] Physical counterpart to Pervasives.compare? Pascal Cuoq
2009-08-25 18:03   ` Christophe Raffalli
2009-08-26 10:25     ` Damien Doligez
     [not found] <20090729030710.BB3C6BC5C@yquem.inria.fr>
2009-07-29  7:04 ` Pascal Cuoq
2009-08-24  7:01   ` Jean-Christophe Filliâtre
2009-07-29  1:25 Elnatan Reisner
2009-07-29  3:06 ` [Caml-list] " Edgar Friendly
2009-07-29  3:58   ` Edgar Friendly
2009-07-29  6:13 ` Alain Frisch

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).