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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 44A3CBC69 for ; Fri, 9 Mar 2007 11:20:47 +0100 (CET) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l29AKkQA014778 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 9 Mar 2007 11:20:47 +0100 Received: from [80.229.56.224] (helo=beast.local) by ptb-relay01.plus.net with esmtp (Exim) id 1HPcDN-0006DR-Kg for caml-list@yquem.inria.fr; Fri, 09 Mar 2007 10:20:45 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Operator overloading Date: Fri, 9 Mar 2007 10:14:55 +0000 User-Agent: KMail/1.9.5 References: <3D1E4D9CA9BCE04D8F2B55F203AE4CE30666AB74@selma.roomandboard.com> <1173432251.22738.2.camel@rosella.wigram> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703091014.56115.jon@ffconsultancy.com> X-Miltered: at discorde with ID 45F134FE.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; overloading:01 typeclass:01 inference:01 overloading:01 inference:01 ocaml:01 ocaml:01 frog:98 wrote:01 caml-list:01 functions:01 objects:02 tradeoff:03 float:03 float:03 On Friday 09 March 2007 09:32, Tom wrote: > Basically, I agree with you. I'm just saying that you can further increase > the "typeclass" of length-able objects to almost anything. Why limit > ourselves? Because there is a tradeoff between type inference and overloading. Operators are conventionally heavily overloaded (e.g. in maths) and having overloaded operators works well. Allowing all functions to be overloaded weakens inference more and doesn't buy you so much, so you must choose to draw the line somewhere. I would like to have "sin" work on float and float32 in F# though... :-) -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. OCaml for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists