Version française
Home     About     Download     Resources     Contact us    
Browse thread
Typeclasses in OCaml (Was: Haskell vs OCaml)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nathaniel Gray <n8gray@g...>
Subject: Re: [Caml-list] Typeclasses in OCaml (Was: Haskell vs OCaml)
On Thu, Aug 14, 2008 at 7:46 AM, Jim Farrand <jim@farrand.net> wrote:
> 2008/8/14 Peng Zang <peng.zang@gmail.com>:
>
>> In Haskell you can write a function that takes anything that is "showable" (a
>> type class) and print it out.  The sig would be something like (I'm mixing
>> OCaml and Haskell syntax here, but hopefully the point is still clear):
>
> 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.

It could be done.  See this paper from POPL '07:

http://portal.acm.org/citation.cfm?id=1190215.1190229

Cheers,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->