From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA16089; Mon, 11 Feb 2002 09:36:12 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA15505 for ; Mon, 11 Feb 2002 09:36:11 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g1B8aBn28061 for ; Mon, 11 Feb 2002 09:36:11 +0100 (MET) Received: (from fpottier@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA15542 for caml-list@inria.fr; Mon, 11 Feb 2002 09:36:10 +0100 (MET) Date: Mon, 11 Feb 2002 09:36:10 +0100 From: Francois Pottier To: caml-list@inria.fr Subject: Re: [Caml-list] Suggestion for overloaded operators Message-ID: <20020211093610.A14866@pauillac.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <006801c1b233$83825ec0$0700a8c0@warp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: <006801c1b233$83825ec0$0700a8c0@warp>; from warplayer@free.fr on Sun, Feb 10, 2002 at 02:04:45PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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. ftp://ftp.dcs.gla.ac.uk/pub/glasgow-fp/authors/Philip_Wadler/how-to-make-ad-hoc-poly-less-ad-hoc.dvi You may also wish to have a look at another interesting paper on the topic: Martin Odersky, Philip Wadler, and Martin Wehr. A second look at overloading. http://lampwww.epfl.ch/~odersky/papers/fpca95.ps.gz Cheers, -- François Pottier Francois.Pottier@inria.fr http://pauillac.inria.fr/~fpottier/ ------------------- 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