caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Weis <pierre.weis@inria.fr>
To: warplayer@free.fr (Nicolas Cannasse)
Cc: xavier.leroy@inria.fr, jhf@hex.no, caml-list@inria.fr
Subject: Re: [Caml-list] Understanding why Ocaml doesn't support operator overloading.
Date: Sat, 30 Nov 2002 22:33:19 +0100 (MET)	[thread overview]
Message-ID: <200211302133.WAA28914@pauillac.inria.fr> (raw)
In-Reply-To: <001c01c297bf$436b7a20$4600a8c0@warp> from Nicolas Cannasse at "Nov 29, 102 04:52:03 pm"

[...]
> Of course the ML type system relies on type inference and need do choose the
> "best available" type but what if we enrich the type system with an "OR"
> operator ? Then if (+) is overloaded on floats, you'll get :
> 
> f :  int -> int OR float -> float
> or something like a type constraint :   f : 'a -> 'a where 'a in [int;float]
> 
> This approach seems trivial to me,

To me too: I just needed 5 years to set up and publish the theory and
Jun Furuse needed 6 years only to write a thesis with full proofs.

So you're right, it is indeed trivial.

> but I really can understand that this require a lot of addins in the
> typing algorithms & theory. BTW, does one of the upper approach has
> already been discussed ? any paper on it ? any countersample that
> will make me feel stupid ? :)

Yes, they are papers on it (to start with, read my POPL'95 paper with
François Rouaix and Catherine Dubois). You may also have a look to
Jun's thesis http://pauillac.inria.fr/~furuse/thesis/.

Have fun!

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      parent reply	other threads:[~2002-11-30 21:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-28 21:02 Jørgen Hermanrud Fjeld
2002-11-28 21:27 ` Jørgen Hermanrud Fjeld
2002-11-29 15:26 ` Xavier Leroy
2002-11-29 15:42   ` Christophe Raffalli
2002-11-29 16:52   ` Nicolas Cannasse
2002-11-29 17:26     ` Michal Moskal
2002-11-30  0:00       ` Mike Lin
2002-11-30 10:24         ` Michal Moskal
2002-11-30 23:06           ` Mike Lin
2002-11-30 21:41         ` William Lovas
2002-12-01 17:30           ` Pierre Weis
2002-12-01 23:41             ` William Lovas
2002-12-02  9:52               ` Remi VANICAT
2002-11-30 21:47         ` Pierre Weis
2002-12-01  7:40           ` Christophe Raffalli
2002-11-30 21:36       ` Pierre Weis
2002-11-30 21:33     ` Pierre Weis [this message]

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=200211302133.WAA28914@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=jhf@hex.no \
    --cc=warplayer@free.fr \
    --cc=xavier.leroy@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).