Hacker News new | ask | show | jobs
by rsaarelm 5554 days ago
I wonder if there's any hope of ever getting type classes in OCaml. Then you'd be able to have stuff like a single "print" function you can give any type of value that can be turned into a string representation.
2 comments

Afaik (and according to Xavier Leroy), it's not planned in mainstream.

Now, implementation of typeclasses is pretty-well documented, so if anyone's willing to finance OCamlPro on this, I don't think there's any technological or scientific barrier.

Type classes or module implicits, that would be great.