[GHC] #12704: Check if constraint synonym satisfies functional dependencies
GHC
ghc-devs at haskell.org
Fri Oct 14 05:50:31 UTC 2016
#12704: Check if constraint synonym satisfies functional dependencies
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner:
Type: bug | Status: new
Priority: low | Milestone:
Component: Compiler | Version: 8.1
(Type checker) |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
When we resolve #12679, it will be possible to implement an abstract type
class using a constraint synonym. However, in my implementation, I didn't
implement functional dependency checking:
{{{
signature H where
class F a b | a -> b
-- This should be an invalid implementation
module H where
type F a b = (Eq a, Eq b)
}}}
The check is annoying fiddly: we have to descend into the constraint
synonym, collect all the implied fundeps, and then see if we have the ones
we need, so I didn't implement it. Maybe some time.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12704>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list