From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 19D5DBC69 for ; Sat, 29 Dec 2007 05:31:07 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABZcdUfQYYRTgWdsb2JhbACQEwEBCQQGAgcgnEU X-IronPort-AV: E=Sophos;i="4.24,219,1196636400"; d="scan'208";a="20765419" Received: from sd-green-bigip-83.dreamhost.com (HELO postalmail-a4.g.dreamhost.com) ([208.97.132.83]) by mail4-smtp-sop.national.inria.fr with ESMTP; 29 Dec 2007 05:31:06 +0100 Received: from localhost (li2-41.members.linode.com [69.56.173.41]) by postalmail-a4.g.dreamhost.com (Postfix) with ESMTP id 3482E11EA9D for ; Fri, 28 Dec 2007 20:31:03 -0800 (PST) Date: Fri, 28 Dec 2007 23:31:02 -0500 From: Dylan William Hardison To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] "OCaml gives you only monomorphic methods in classes." Message-ID: <20071229043102.GA22870@hardison.net> Mail-Followup-To: caml-list@yquem.inria.fr References: <200712282337.23952.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200712282337.23952.jon@ffconsultancy.com> X-Uptime: 23:18:36 up 93 days, 9:51, 4 users, load average: 0.13, 0.07, 0.01 Reply-By: Tue Dec 25 23:18:36 EST 2007 X-Message-Flag: OUTLOOK ERROR: Message in violation of Microsoft Security Policy (MSP). X-Religion: Optimus Prime User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam: no; 0.00; ocaml:01 milner:01 inference:01 ocaml:01 haskell:01 overloading:01 polymorphism:01 odersky:01 o'caml:01 haskell:01 haskell's:01 gpg:01 28,:98 sml:01 integer:01 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