Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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:  FAQ:
To unsubscribe, mail  Archives: