[Haskell-cafe] A type class puzzle

Jim Apple jbapple+haskell-cafe at gmail.com
Sat Nov 4 16:54:46 EST 2006


On 11/2/06, Yitzchak Gale <gale at sefer.org> wrote:
> GHC says:
>
>     Functional dependencies conflict between instance declarations:
>       instance Replace Zero a a (a -> a -> a)
>       instance (...) => Replace (Succ n) a [l] f'
>
> Not true. The type constraints on the second instance
> prevent any overlap.

GHC doesn't take constraints into account when checking fundeps.
You're looking for Sulzmann's Chameleon, which does all sorts of
constraint magic.

http://www.comp.nus.edu.sg/~sulzmann/chameleon/

Also, I'd be surprized if Oleg didn't have a work-around in GHC.

Jim


More information about the Haskell-Cafe mailing list