-
Why does Haskell have functional dependencies?
Because multi-parameter type classes can sometimes have ambiguous instances.
-
Why does Haskell have multi-parameter type classes?
Because the original (single parameter) type classes limited expressivity.
-
Why does Haskell have type classes?
To provide a means of reusing symbols with different types - overloading.
Having recently seen this:
- A functional programming language (suitable for education of functional programming) (2018) [from page 33 of 97]
and having already seen this some time ago:
- The implementation of practical functional programming languages (1991) [from page 63 of 144]
…is the very concept of a type class a mistake (or at least flawed)? Because it seems to me that the “Jenga-tower” of a type system Haskell now has is largely the consequence of that original decision.