#6028: warning for cyclic unimplemented defaults
------------------------------+---------------------------------------------
Reporter: lerkok | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 7.4.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
------------------------------+---------------------------------------------
It's really nice how GHC warns when a class method is left out
unimplemented. Alas, GHC does not warn if there's a default implementation
that only works in case another method is defined.
Here's an example: The Num class allows either negate or '-' to be
defined, providing default definitions for each in terms of the other. If
a user leaves both undefined, then he gets himself a nice little tight-
loop with no warnings. To break the cycle, the user should implement at
least one of these. Thus, it would be really nice if GHC warned in such
cases.
I'm guessing that GHC already has all the relevant information at hand
when compiling an instance declaration, so I'm hoping it's not too much
work to warn if there's such a cyclic dependency; just like it warns if
the user leaves methods unimplemented.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6028>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs