Ambiguity and constrained polymorphism

Published in Science of Computer Programming, 2016

This paper considers the problem of ambiguity in Haskell-like languages. The relation between ambiguity and overloading resolution and the disadvantages of following the standard notion of ambiguity in the con- text of constrained polymorphism are exposed and discussed. A new definition of ambiguity is presented, where existence of more than one instance for an expression type is considered only after overloading resolution. We identify overloading resolution by the presence of unreachable variables in constraints on the type of the expression. We discuss advantages of adopting this ambiguity definition in Haskell.

Download paper here