Generics and Constrained Polymorphism versus Subtyping
问题 In this PDF presentation on Haskell Type Classes, slide #54 has this question: Open Question : In a language with generics and constrained polymorphism, do you need subtyping too? My questions are: How do generics and constrained polymorphism make subtyping unnecessary? If generics and constrained polymorphism make subtyping unnecessary, why does Scala have subtyping? 回答1: How do generics and constrained polymorphism make subtyping unnecessary? It is not known that they do. If you put the