[GHC] #10194: Shouldn't this require ImpredicativeTypes?

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Type checker) | Operating System: Unknown/Multiple Keywords: | Type of failure: GHC accepts Architecture: | invalid program Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- The following program compiles: {{{ {-# LANGUAGE RankNTypes #-} module TestRN1 where type X = forall a . a comp :: (X -> c) -> (a -> X) -> (a -> c) comp = (.) }}} But this one fails: {{{ {-# LANGUAGE RankNTypes #-} module TestRN2 where comp :: ((forall a . a) -> c) -> (a -> (forall a . a)) -> (a -> c) comp = (.) }}} Error: {{{ Cannot instantiate unification variable ‘b0’ with a type involving foralls: forall a1. a1 Perhaps you want ImpredicativeTypes In the expression: (.) In an equation for ‘comp’: comp = (.) }}} I would expect both to fail. Both seem to rely on impredicative types. I wouldn't expect expansion of a type synonym to make a difference between a type-checking program and one that does not typecheck. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Changes (by adamgundry): * cc: adamgundry (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Changes (by jstolarek): * cc: jstolarek (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Changes (by dfeuer): * cc: dfeuer (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes?
-------------------------------------+-------------------------------------
Reporter: kosmikus | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.8.4
checker) | Keywords:
Resolution: | Architecture:
Operating System: Unknown/Multiple | Unknown/Multiple
Type of failure: GHC accepts | Test Case:
invalid program | Blocking:
Blocked By: | Differential Revisions:
Related Tickets: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge * testcase: => typecheck/should_fail/T10194 Comment: Excellent point. Fixed. (I doubt this is worth the trouble of merging to 7.10.2, but could be.) Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed * milestone: => 7.10.2 Comment: Merged to `ghc-7.10` via 681d82c0d44f06f0b958b75778c30b0910df982b -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by refold): Apparently this fix means that some programs that compiled with 7.10.1 now fail with 7.10.2. One reported example is `xmonad-contrib`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: closed => merge Comment: OK, Ben can you try to merge this? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thoughtpolice): But it's already merged; should we un-merge it? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by adamgundry): @refold can you be more specific about what breaks? One would expect some programs that were previously (erroneously) accepted to now require `-XImpredicativeTypes`. That's not necessarily a reason to revert this patch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by refold): Replying to [comment:10 adamgundry]:
One would expect some programs that were previously (erroneously) accepted to now require `-XImpredicativeTypes`.
Yes, that's what seems to happen in the `xmonad-contrib` case: {{{ XMonad/Layout/Groups/Helpers.hs:181:8: Cannot instantiate unification variable `a0' with a type involving foralls: G.ModifySpec Perhaps you want ImpredicativeTypes In the expression: sendMessage . G.Modify In an equation for `wrap': wrap = sendMessage . G.Modify XMonad/Layout/Groups/Helpers.hs:181:22: Cannot instantiate unification variable `a0' with a type involving foralls: G.ModifySpec Perhaps you want ImpredicativeTypes In the second argument of `(.)', namely `G.Modify' In the expression: sendMessage . G.Modify }}}
That's not necessarily a reason to revert this patch.
The issue doesn't affect me personally, so I'm not going to argue. My comment was JFYI. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by adamgundry): Thanks! Indeed, those look like impredicative instantiations of `(.)` that should require `ImpredicativeTypes`. I think we should keep the patch, and flag up this issue in the release notes, although the error message makes it fairly obvious how to fix the problem. :-) Or should we be more concerned about maintaining support for existing programs, given that this is a bugfix release? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Well this _is_ a bugfix! It's just that fixing the bug makes some programs be rejected that should be rejected. I propose that we keep it. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Or should we be more concerned about maintaining support for existing
#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nomeata): programs, given that this is a bugfix release? As a user, I would be upset if a bugfix release of a compiler suddenly stops compiling programs that it was compiling previously (unless the compilation was producing bogus results before, but that is not the case here, I believe). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by goldfire): Though I am not at all affected by this, I agree with Joachim (nomeata). I think this sort of wibble in a patch release just makes users groan, and for no great reason beyond pedantry. (I'm not using ''pedantry'' negatively there, as doing so would be quite hypocritical, but that really is the only reason for this change.) I propose unmerging but surely keeping the fix in master. It ''is'' a bugfix, but just not one that needs to be released at the moment. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: merge Priority: highest | Milestone: 7.10.2 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * priority: normal => highest Comment: OK fair enough. Un-merging is fine with me. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10194: Shouldn't this require ImpredicativeTypes? -------------------------------------+------------------------------------- Reporter: kosmikus | Owner: Type: bug | Status: closed Priority: highest | Milestone: 7.12.1 Component: Compiler (Type | Version: 7.8.4 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T10194 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * milestone: 7.10.2 => 7.12.1 Comment: Reverted in 8fb101e49b86c0f8bb8931620c9c3cd3e6c57228 on `ghc-7.10`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10194#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC