[GHC] #8821: Functional dependency coverage check does not use type equalities

#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

#8821: Functional dependency coverage check does not use type equalities --------------------------------------------+------------------------------ Reporter: glguy | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: --------------------------------------------+------------------------------ Changes (by glguy): * status: new => closed * resolution: => invalid Comment: Iavor explained that Undecidable Instances is allowing the functional dependency to consider the context and that the test is working. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8821#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC