On Mon, Sep 02, 2002 at 03:11:58AM -0700, Ashley Yakeley wrote:
At 2002-09-02 02:46, Jerzy Karczmarczuk wrote:
class Module v s | v->s . ... instance Num s => Module (v->s) s ... instance ...=> Module ((v->s)->(v->s)) s ... But GHCi yells that two instances in view of the functional dependency declared are in conflict.
GHCi is correct. Bear in mind GHC ignores contexts in instance declarations when calculating conflicts. This is unfortunate, but apparently fixing it would be hard.
Even taking contexts into account, these two might still conflict: if you had instance Num ((v->s)->v) for some values of v and s, you would get a conflict. GHC (and Hugs) check for potential conflicts like this unless you explicitly allow overlapping instances. --Dylan