3 ms·
OCaml has a powerful module system which can be used in a way quite similar to typeclasses (https://ocaml.janestreet.com/?q=node/37 https://ocaml.janestreet.com
by njs12345 15y ago
OCaml has a powerful module system which can be used in a way quite similar to typeclasses (https://ocaml.janestreet.com/?q=node/37 https://ocaml.janestreet.com/?q=node/37).
The main difference is the lack of purity, which means that the side effects of a function aren't part of a function's type. It also doesn't have the wide variety of extensions which you can use to do really crazy stuff (like verifiably correct red-black trees, https://github.com/yairchu/red-black-tree/blob/master/RedBlackTree.hs https://github.com/yairchu/red-black-tree/blob/master/RedBla...).
- gtani 15y agoThat modules vs. types has been going on for awhile http://news.ycombinator.com/item?id=2622166 http://news.ycombinator.com/item?id=2622166 http://www.cs.washington.edu/education/courses/cse505/98au/slides/slides.10-26.ps http://www.cs.washington.edu/education/courses/cse505/98au/s... http://news.ycombinator.com/item?id=3481700 http://news.ycombinator.com/item?id=3481700 http://news.ycombinator.com/item?id=3641355 http://news.ycombinator.com/item?id=3641355