overlapping instances and constraints

Taral taralx at gmail.com
Tue Feb 28 10:30:56 EST 2006

On 2/28/06, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> Tuesday, February 28, 2006, 1:54:25 PM, you wrote:
> CR>     class NEq a b
> CR>     instance Fail a => NEq a a
> CR>     instance NEq a b
> i think that this definition just use ad-hoc overlapping instances
> resolution mechanism that we want to avoid :)))

Actually, it illustrates beautifully why ad-hoc overlapping doesn't
work. There are two interpretations, the desired one, and one that
just ignores the the first and uses the second for everything.

Taral <taralx at gmail.com>
"Computer science is no more about computers than astronomy is about
    -- Edsger Dijkstra

More information about the Haskell-prime mailing list