
4 Nov
2006
4 Nov
'06
4:54 p.m.
On 11/2/06, Yitzchak Gale
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