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
"OCaml gives you only monomorphic methods in classes."
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dylan William Hardison <dylan@h...>
Subject: Re: [Caml-list] "OCaml gives you only monomorphic methods in classes."
Spake Jon Harrop on Friday, December 28, 2007 at 11:37PM +0000:
> I just read this quote and I do not understand what it means:
>   "In particular, the Hindley/Milner style of type inference used in languages 
> such as OCaml or Haskell is incompatible with lots of assumptions of OO 
> languages. One incompatibility is with overloading. That's why OCaml does not 
> let you write + for both integer and floating point addition. Another 
> incompatibility is with higher order polymorphism. That's why OCaml gives you 
> only monomorphic methods in classes." - Martin Odersky

This seems correct for O'Caml (and SML?) but not Haskell.
Haskell's type system is extended with type classes, which allow + and such to
be overloaded...

"Regardless of the legal speed limit, your Buick must be operated at
speeds faster than 85 MPH (140kph)."
              -- 1987 Buick Grand National owners manual.
GPG Fingerprint: 412C CCE9 DDA2 4FE9 C34F  754B 0863 0EA6 712E BBE1