[GHC] #8821: Functional dependency coverage check does not use type equalities
GHC
ghc-devs at haskell.org
Mon Feb 24 22:55:23 UTC 2014
#8821: Functional dependency coverage check does not use type equalities
-------------------------------------------+-------------------------------
Reporter: glguy | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 7.6.3
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking:
-------------------------------------------+-------------------------------
When checking the coverage condition to validate an instance, we should
also consider equality constraints because they have a dependency in both
directions.
{{{
class C a b | a -> b
instance (a ~ b) => C a b
-- Illegal instance declaration for ‛C a b’
-- The coverage condition fails in class ‛C’
-- for functional dependency: ‛a -> b’
-- Reason: lhs type ‛a’ does not determine rhs type ‛b’
-- Using UndecidableInstances might help
-- In the instance declaration for ‛C a b’
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8821>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list