4 ms·
We know how to do type-directed operator overloading in unambiguous cases, eg. static methods in OO, modules and typeclasses in FP. This is often (ab)used to di
by chriswarbo 12y ago
We know how to do type-directed operator overloading in unambiguous cases, eg. static methods in OO, modules and typeclasses in FP. This is often (ab)used to distinguish between alternative definitions. For example, Haskell's Monoid module defines several type synonyms for booleans and numbers, each of which has a different Monoid definition: https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Monoid.html https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-M...
If we trigger an error for ambiguous cases, the path of least resistance is to make things unambiguous.