caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Judicael.Courant@lip.ens-lyon.fr (Judicael Courant)
To: caml-list@pauillac.inria.fr
Cc: John.Harrison@cl.cam.ac.uk
Subject: Polymorphic comparison
Date: Tue, 18 Oct 94 11:40:09 +0100	[thread overview]
Message-ID: <9410181040.AA18410@lip.ens-lyon.fr> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

Hello,

I think this polymorphic comparison is quite easy to implement in the
following way:

#open "hashtbl";;
let c x y = (hash x) <= (hash y);;
#infix "c";;


#3 c true;;
- : bool = true
#[ "hello" ; "world" ] c 3.14159;;
- : bool = false


But, as Pierre Weis, I am wondering what to do with such a function...

Maybe
let c (x:'a) (y:'a) = (hash x) <= (hash y);;
would be more suitable ?

-- 
Judicaël COURANT           tel. : 72 72 85 82
ENSL - LIP                 email : Judicael.Courant@ens-lyon.fr
46, allée d'Italie
69364 Lyon cedex 07
--




             reply	other threads:[~1994-10-18 10:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-18 10:40 Judicael Courant [this message]
1994-10-18 12:54 ` John Harrison
1994-10-19  8:47   ` Xavier Leroy
  -- strict thread matches above, loose matches on Subject: below --
1994-10-18 12:46 Franck.Delaplace
1994-10-18  9:43 Pierre Weis
1994-10-18  9:32 Pierre Weis

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=9410181040.AA18410@lip.ens-lyon.fr \
    --to=judicael.courant@lip.ens-lyon.fr \
    --cc=John.Harrison@cl.cam.ac.uk \
    --cc=caml-list@pauillac.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).