[Haskell-cafe] Is it possible to represent such polymorphism?

Malcolm Wallace malcolm.wallace at me.com
Mon Oct 3 10:05:15 CEST 2011

> Although I still wonder why something so simple in C++ is actually more verbose and requires less known features in Haskell...What was the design intent to disallow simple overloading?

The "simple" C++ overloading you want to add to Haskell, is in fact rather semantically complex, and it leads to undecidability of the type system.  The inherent formal complexity here suggests that this form of overloading is highly unlikely to be the correct solution in practice to the problem you are trying to solve.  And even if it were a technically correct solution, it is likely to be unmaintainable and fragile to code changes.  There is a high probability that a more-formally-tractable solution exists, and that using it will improve your understanding of the problem at hand, and make your code more regular and robust to change.


More information about the Haskell-Cafe mailing list