4 ms·
An interesting aspect of Haskell is that it tries really really hard to avoid subtyping, relying instead on other mechanisms. This talk by Simon Peyton Jones to
by danidiaz 11y ago
An interesting aspect of Haskell is that it tries really really hard to avoid subtyping, relying instead on other mechanisms. This talk by Simon Peyton Jones touches on it from minute 40 onwards: https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=3640b30a-38b9-49a6-b95c-d96e93bc9284 https://imperial.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?...
"In a language with generics & constrained polymorphism, do you really need subtyping too?"
- marcosdumay 11y agoHaskell has interface based generics, just like the article wants people to write. It just calls its interfaces by classes, and has a more powerful implementation than Java, that deals with default code and makes incompatibilities impossible. Haskell even allows interface inheritance, just like Java, but calls it by... well, no name that I'm aware of, but it's there.