28 Dec
2007
28 Dec
'07
3:52 p.m.
Hi
The trouble, of course, is that classes could have rather complicated "minimum instance" requirements. Still, if someone came up with a decent syntax such as (but better than)
You don't need a syntax, the information is already there. You also don't need to do complicated non-termination analysis. Taking the slightly simpler example of: class Eq a where a == b = not (a /= b) a /= b = not (a == b)
From this example its clear that (==) depends on (/=) and that (/=) depends on (==). i.e. its obvious they form a cycle. If the default methods form a cycle, and the user has not broken that cycle by inserting a real implementation, that's almost certainly a bug - I'd go as far as to say its an error rather than a warning.
Thanks Neil