
#15231: UndecidableInstances validity checking is wrong in the presence of QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.5 checker) | Keywords: Resolution: | QuantifiedConstraints Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): GHC is following [https://github.com/Gertjan423/ghc-proposals/blob /quantified-constraints/proposals/0000-quantified-constraints.rst the proposal (Section 3.7)]. Specifically, in the quantified predicate `c => Z a`, `c` does occur more often in the constraint to the left of the arrow, namely `c`, than in the head of the quantified constraint `Z a`. The error message is poor. How about this? {{{ • Variable ‘c’ occurs more often in the constraint ‘c’ than in the instance head `Z a' (Use UndecidableInstances to permit this) • In the quantified constraint `c => Z a` • In the instance declaration for ‘Z (ECC c a)’ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15231#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler