caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Alternative to Haskell type classes?
@ 2005-12-02  0:12 Jonathan Roewen
  0 siblings, 0 replies; only message in thread
From: Jonathan Roewen @ 2005-12-02  0:12 UTC (permalink / raw)
  To: caml-list

Hi,

I'm just curious about OCaml's stance on Haskell's type classes, and
also whether there are alternative ways of achieving the same thing in
OCaml.

There are some damn useful small things that Haskell's type classes
can do, that I find interesting.

First is Show, like the base method toString in Java, etc. The other
is Enum which lets you convert an enum type to an int, and back again.

I've heard comments on it before for the Num type class, saying how it
hurts performance .. why can't the compiler specialise uses of type
classes so that such overhead is eliminated? They're just overloaded
functions, whose type for each individual invocation is completely
known I believe.

Jonathan


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-12-02  0:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-02  0:12 [Caml-list] Alternative to Haskell type classes? Jonathan Roewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).