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.7 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 7FA15BB84 for ; Fri, 15 Aug 2008 01:40:37 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicCAC9fpEjYi40Jomdsb2JhbACSAAEBAQEBAQcFBgkRpCuBVQ X-IronPort-AV: E=Sophos;i="4.32,211,1217800800"; d="scan'208";a="14003726" Received: from mail-out9.nyct.net (HELO mail.nyct.net) ([216.139.141.9]) by mail2-smtp-roc.national.inria.fr with ESMTP; 15 Aug 2008 01:40:36 +0200 Received: from [192.168.42.2] (pool-96-250-136-121.nycmny.east.verizon.net [96.250.136.121]) (authenticated bits=0) by mail.nyct.net (8.14.2/8.14.1) with ESMTP id m7ENeRsa027269 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Thu, 14 Aug 2008 19:40:29 -0400 (EDT) (envelope-from bhurt@spnz.org) Date: Thu, 14 Aug 2008 20:21:11 -0400 (EDT) From: Brian Hurt X-X-Sender: bhurt@localhost To: Jim Farrand Cc: Caml Mailing List Subject: Re: [Caml-list] Typeclasses in OCaml (Was: Haskell vs OCaml) In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam: no; 0.00; ocaml:01 haskell:01 ocaml:01 haskell:01 monads:01 functors:01 vice-versa:01 functorizing:01 functors:01 peng:98 peng:98 wrote:01 caml-list:01 theoretical:03 thu:05 On Thu, 14 Aug 2008, Jim Farrand wrote: > 2008/8/14 Peng Zang : > > Out of curiosity, are there any theoretical reasons why OCaml could > not be extended with type classes? They are one of my favourite > features of Haskell, and I think they would really improve OCaml. Because everything you can do with type classes you can do with monads and functors, and vice-versa. If you're thinking "hey, this would be a real nice function to have type classes for", try functorizing it. Use the features the language already has, instead of wishing for new ones. Some things are clunky to do in functors, I agree, but the same can be said of type classes- and I'm far from convinced that type classes are innately a better idea than functors. Brian