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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL 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 9ED46BC6C for ; Mon, 28 Jan 2008 16:15:24 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAAeAnUfAXQInh2dsb2JhbACQKgEBAQgKKZUUhTw X-IronPort-AV: E=Sophos;i="4.25,260,1199660400"; d="scan'208";a="8453896" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 28 Jan 2008 16:15:24 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m0SFFNZY003089 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 28 Jan 2008 16:15:24 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAAeAnUfRVYT4emdsb2JhbACQKgEBCQgplRaFPA X-IronPort-AV: E=Sophos;i="4.25,260,1199660400"; d="scan'208";a="7334030" Received: from an-out-0708.google.com ([209.85.132.248]) by mail1-smtp-roc.national.inria.fr with ESMTP; 28 Jan 2008 16:15:20 +0100 Received: by an-out-0708.google.com with SMTP id c24so369979ana.97 for ; Mon, 28 Jan 2008 07:15:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=dnhYww0MCzcM5/hrlFXBg+2KA+30COKaoAbIoUS3QUc=; b=XkX/g1orWIsFlHYn/m40FC6SnOVvvAxfzctVUHvhvJE2CAtR22NkF+1O839/WMscnlon1DnqhGcOOGSDEPFxaaNWJKOfNKD6yHWRzZDEGWdOueX/787gvVFzcHh4qgfqe7ZyknZ4zgDdztPK1j9KNr4a1j5Er65+TZcNhh024dg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=D9M13Al8oMJKHwo3Gc+TJ5cWUF+aMTyWju64VGaOfgZpb5sC3P4Q9bs5hy5M3f3lCXREl9wH+sUZ/uB5QiggcUcKpWiJ5o2icEo6UQfz3ElFxhrP+nIAl88jGWTPpxswIy2PVcZtH4Cn963fuYoJPRtgp26y9gtZlFwB6arYklc= Received: by 10.100.201.16 with SMTP id y16mr12145359anf.30.1201533318266; Mon, 28 Jan 2008 07:15:18 -0800 (PST) Received: by 10.101.1.17 with HTTP; Mon, 28 Jan 2008 07:15:18 -0800 (PST) Message-ID: <6f9f8f4a0801280715m43275999k6d3e7294c2717107@mail.gmail.com> Date: Mon, 28 Jan 2008 16:15:18 +0100 From: "Loup Vaillant" To: "Brian Hurt" Subject: Re: [Caml-list] [OSR] OCaml Standard Recommandation Process Cc: "Jon Harrop" , yminsky@gmail.com, caml-list@inria.fr In-Reply-To: <479DE545.9050306@janestcapital.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1201440183.6302.27.camel@Blefuscu> <200801272107.23900.jon@ffconsultancy.com> <891bd3390801271347y56af21cam492ccaac1348bb05@mail.gmail.com> <200801281204.00689.jon@ffconsultancy.com> <479DE545.9050306@janestcapital.com> X-Miltered: at concorde with ID 479DF18B.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 overloading:01 inference:01 inference:01 overloading:01 foo:01 non-trivial:01 ocaml:01 checker:01 variants:01 annotations:01 unacceptable:01 28,:98 havoc:98 imho:01 2008/1/28, Brian Hurt : > I *hate* operator overloading. My experience in C++ is for every time > this feature is used legitimately (i.e. to implement complex numbers or > whatever), it's abused 10 times- and that's ignoring C++'s use of the > bit shift operators << and >> for I/O, and the use of + for string > concatentation, both of which I'd argue really should be considered > abuses, as far as I'm concerned. And this is ignoring the difficulty of > type inference in the presence of overloaded operators. > > The best way to handle this IMHO is Haskell-style type classes. Which > solves the whole type inference problem, and rules most of what I > consider abuses of operator overloading (for example, if you have a '+' > operator, you also have to have a '*' operator- and what is "foo" * > "bar"?). But this is a very non-trivial change to the language. Err, are you really suggesting type classes to be added in Ocaml? Doing that properly would require to change the whole standard library, breaking havoc in every single Ocaml program, even the simplest print_string "Hello World";; I also heard that the current type checker is "quite" complicated (labels, variants, objects...). Type classes fits well with a naked Hindley-Milner type system, but how would it interact with the extra Ocaml features? Finally, it may make some type annotations mandatory, which may be viewed a unacceptable. (I'm not sure of this one, though.) Maybe type classes should be added, but I'm afraid they can't. :-( Loup