Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

OCaml also has a really good subtyping implementation in the often-used polymorphic variant system. I'll just quote from http://roscidus.com/blog/blog/2014/02/13/ocaml-what-you-gain... :

> Their real purpose is to support subsets and supersets, which are useful all over the place.

And indeed they are super useful, e.g. I am using them to implement functions that deal with web responses: some can deal with only HTTP responses, some with only WebSocket responses, and some with either. All completely type-safe and extensible.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: