caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Variants & structural ordering
Date: Tue, 5 Feb 2008 15:04:38 +0000	[thread overview]
Message-ID: <200802051504.38263.jon@ffconsultancy.com> (raw)
In-Reply-To: <20080205081845.2D24D1C02531@mwinf2341.orange.fr>

On Tuesday 05 February 2008 08:21:21 Damien Guichard wrote:
> Hi everybody,
>
> Typically, when you declare:
>
> type card =
>
>   | Card of int
>   | Jack
>   | Queen
>   | King
>   | Ace
>
>   ;;
>
> The relation you wish is:
>
> Card(2) < ...< Card(10) < Jack < Queen < King < Ace
>
> And that's what you get when using F#.

Comparison is OCaml's achilles heel and this is one (minor) manifestation of 
that. The ability to develop a program and break a use of polymorphic 
comparison buried within it without knowing is far more serious and has 
caused many people untold grief in the past.

SML's equality types are a slight improvement but F# and Haskell's solutions 
are the best way forward AFAICT. OCaml will never be fixed in this sense but, 
hopefully, a next-generation FPL implementation will solve these problems 
without sacrificing OCaml's other benefits.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e


  parent reply	other threads:[~2008-02-05 15:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05  8:21 Damien Guichard
2008-02-05  9:47 ` [Caml-list] " Berke Durak
2008-02-05  9:48 ` Oliver Bandel
2008-02-05 15:04 ` Jon Harrop [this message]
2008-02-06  8:21 ` Michaël Grünewald
2008-02-07 15:50 ` Damien Doligez
2008-02-05 16:59 Damien Guichard
2008-02-05 17:25 ` Stéphane Lescuyer

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=200802051504.38263.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --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).