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=AWL autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 5A1B2BC69 for ; Sat, 29 Dec 2007 02:40:06 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FALY0dUfUnw7UdWdsb2JhbACCNY1dAQoEBg8TB5xN X-IronPort-AV: E=Sophos;i="4.24,218,1196636400"; d="scan'208";a="7306988" Received: from ptb-relay01.plus.net ([212.159.14.212]) by mail3-smtp-sop.national.inria.fr with ESMTP; 29 Dec 2007 02:40:06 +0100 Received: from [80.229.56.224] (helo=beast.local) by ptb-relay01.plus.net with esmtp (Exim) id 1J8QgH-0004K7-2P for caml-list@yquem.inria.fr; Sat, 29 Dec 2007 01:40:05 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] "OCaml gives you only monomorphic methods in classes." Date: Sat, 29 Dec 2007 01:30:43 +0000 User-Agent: KMail/1.9.7 References: <200712282337.23952.jon@ffconsultancy.com> <200712290027.26471.jon@ffconsultancy.com> <1A5E39DC-CCAE-48B2-AC06-C671143A6C50@mac.com> In-Reply-To: <1A5E39DC-CCAE-48B2-AC06-C671143A6C50@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712290130.43945.jon@ffconsultancy.com> X-Spam: no; 0.00; ocaml:01 foo:01 foo:01 annotations:01 assertion:01 frog:98 wrote:01 compile:01 caml-list:01 oop:01 monomorphic:01 int:01 int:01 argument:02 argument:02 On Saturday 29 December 2007 01:19:53 Gordon Henriksen wrote: > Oh, were you proposing a language feature? In that case, consider: > > let bar x = foo x > > How to compile that? The call to "foo" uses an argument with the type '_a. That is the bail case, giving an error saying that overloads require type annotations. I think this is exactly what F# does. If you wanted to be more fancy you could allow that and just copy the requirements upon "x". So if you know foo's argument is [int|string] then bar's argument would also be [int|string]. I'm not proposing language features so much as just trying to understand Martin's assertion that integrating statically-typed FP with nominally-subtyped OOP is an unsolved problem. This doesn't even seem hard, let alone unsolved, but I can't think what I'm missing. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e