English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Suggestion for overloaded operators
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-02-11 (08:36)
From: Francois Pottier <francois.pottier@i...>
Subject: Re: [Caml-list] Suggestion for overloaded operators

On Sun, Feb 10, 2002 at 02:04:45PM +0100, Warp wrote:
> The compiler will seek for a function named :
>     typea_add_typeb : typea -> typeb -> typer

Your proposal is reasonable, but you forget that typea and typeb might be
unknown, and might remain unknown for quite a while. For this reason,
overloading poses a difficult type inference problem. One elegant way to solve
it is embodied by Haskell's type classes:

  P. Wadler and S. Blott.
  How to make ad-hoc polymorphism less ad-hoc. 

You may also wish to have a look at another interesting paper on the

  Martin Odersky, Philip Wadler, and Martin Wehr.
  A second look at overloading.


François Pottier
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr