[GHC] #11762: GHC 8 superclass chain constraint regression

#11762: GHC 8 superclass chain constraint regression -------------------------------------+------------------------------------- Reporter: _deepfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc2 (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: -------------------------------------+------------------------------------- It seems that GHC 8 regresses with regard to GHC 7.10, when it tries to satisfy the constraints, implied by instance context. The following does not build on GHC 8.0.1 RC2, but does on 7.10.3: {{{#!hs {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} --{-# LANGUAGE UndecidableSuperClasses #-} -- this doesn't matter {-# LANGUAGE UnicodeSyntax #-} module Foo where class Super a class Super a ⇒ Left a class Super a ⇒ Right a instance (Left a) ⇒ Right a }}} the error being:
• Could not deduce (Super a) arising from the superclasses of an instance declaration from the context: Left a bound by the instance declaration at repro.hs:9:10-27 Possible fix: add (Super a) to the context of the instance declaration • In the instance declaration for ‘Right a’
It also /roughly/ seems that https://phabricator.haskell.org/D1594 could possibly be related. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11762 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11762: GHC 8 superclass chain constraint regression -------------------------------------+------------------------------------- Reporter: _deepfire | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler (Type | Version: 8.0.1-rc2 checker) | Resolution: | Keywords: 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: normal => high * failure: None/Unknown => GHC rejects valid program * milestone: => 8.0.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11762#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11762: GHC 8 superclass chain constraint regression -------------------------------------+------------------------------------- Reporter: _deepfire | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 8.0.1-rc2 checker) | Resolution: | Keywords: 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: simonpj (added) * priority: high => highest Comment: Pinging simonpj. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11762#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11762: GHC 8 superclass chain constraint regression -------------------------------------+------------------------------------- Reporter: _deepfire | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 8.0.1-rc2 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #11427 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by jme): * related: => #11427 Comment: This seems to be the same as #11427--see especially ticket:11427#comment:3. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11762#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11762: GHC 8 superclass chain constraint regression -------------------------------------+------------------------------------- Reporter: _deepfire | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 8.0.1-rc2 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #11427 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by _deepfire): Oh my god, does it mean we are going to sacrifice the very convenient, simple and obvious (for some value of "simple" and "obvious") implication on the altar of recursive superclasses? Because #11427 seems to conclude in that way.. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11762#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11762: GHC 8 superclass chain constraint regression -------------------------------------+------------------------------------- Reporter: _deepfire | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 8.0.1-rc2 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #11427 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Yes, it's the same as #11427. It doesn't bite often, and it's also easy to fix, thus {{{ instance (Super a, Left a) ⇒ Right a }}} What I most dislike about it is that it's hard to explain and justify. I would like a better way to do this, but I don't know one. Better ideas welcome! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11762#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11762: GHC 8 superclass chain constraint regression -------------------------------------+------------------------------------- Reporter: _deepfire | Owner: Type: bug | Status: closed Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 8.0.1-rc2 checker) | Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: #11427 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => duplicate Comment: OK so currently this is by design, and so I'll mark it as invalid By all means suggest something better, but we can't do much for 8.0. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11762#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11762: GHC 8 superclass chain constraint regression
-------------------------------------+-------------------------------------
Reporter: _deepfire | Owner:
Type: bug | Status: closed
Priority: highest | Milestone: 8.0.1
Component: Compiler (Type | Version: 8.0.1-rc2
checker) |
Resolution: duplicate | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: #11427 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC