Version française
Home     About     Download     Resources     Contact us    
Browse thread
What is a future of ocaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Allsopp <dra-news@m...>
Subject: RE: [Caml-list] What is a future of ocaml?
Dawid Toton wrote:
> Could anybody explain why it's impossible to have type classes in OCaml?

I don't think it's impossible - but I believe that if you introduce type
classes then you "damage" Hindley-Milner type inference and you can no
longer derive a principal typing for an arbitrary ML expression without
resorting to type annotations. Whether this is a problem or not is a matter
of taste - but it does make the language harder to call "ML" if you lose one
of its central features! That said, there are of course two big features
(objects and polymorphic variants) in OCaml already which do require
annotations.


David