[GHC] #13391: PolyKinds is more permissive in GHC 8

#13391: PolyKinds is more permissive in GHC 8 -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC accepts Unknown/Multiple | invalid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The docs claim that the definition in section 9.11.10 {{{ data G (a :: k) where GInt :: G Int GMaybe :: G Maybe }}} "requires that `-XTypeInType` be in effect", but this isn't the case. The following compiles with GHC-8.0.2: {{{ {-# LANGUAGE PolyKinds, GADTs #-} data G (a :: k) where GInt :: G Int GMaybe :: G Maybe }}} The example does *not* compile with 7.10.3, so this seems to be a case where `-XPolyKinds` has become more permissive in GHC 8 (as outlined in section 9.11.1). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13391 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13391: PolyKinds is more permissive in GHC 8 -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => newcomer Comment: Good catch. I suspect fixing this wouldn't be too challenging. If you look at the commitdiff for 6746549772c5cc0ac66c0fce562f297f4d4b80a2 (Add kind equalities to GHC), searching for `badGadtKindCon` will give you the check that used to be in place for catching datatypes that are GADT-like in their kind arguments. Fixing this issue should hopefully be a matter of reinstating that check, but guarded behind a check for the presence of `-XTypeInType`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13391#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13391: PolyKinds is more permissive in GHC 8 -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer, | TypeInType Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: newcomer => newcomer, TypeInType -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13391#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13391: PolyKinds is more permissive in GHC 8 -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer, | TypeInType Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): I don't think this is quite so easy. The old check needed to tell the difference between types and kinds. We can't do that anymore! It is a shame that this happens though. If no one gets there first, I'll fix this in my `TypeInType` bug sweep this summer. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13391#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13391: PolyKinds is more permissive in GHC 8 -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer, | TypeInType Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Replying to [comment:3 goldfire]:
I don't think this is quite so easy. The old check needed to tell the difference between types and kinds. We can't do that anymore!
Ah, good point. I'll remove the "newcomer" label so that we don't accidentally lead a new GHC contributor down a rabbit hole they can't climb back out of (something which has happened to me more times than I care to admit). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13391#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13391: PolyKinds is more permissive in GHC 8 -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: TypeInType Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: newcomer, TypeInType => TypeInType -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13391#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13391: PolyKinds is more permissive in GHC 8 -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: TypeInType Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3859 Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => patch * differential: => Phab:D3859 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13391#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13391: PolyKinds is more permissive in GHC 8 -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: TypeInType Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3859 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): One non-obvious implication of this change is that program like the `KindEqualities` test from the testsuite will now require that users enable `TypeInType` and consequently will manually need to quantify over the kind variables of their tycon's signature. For instance, currently `KindEqualities` has, {{{#!hs data TyRep :: k -> * where TyInt :: TyRep Int -- etc. }}} This needs to become, {{{#!hs data TyRep :: forall k. k -> * where TyInt :: TyRep Int -- etc. }}} This is documented in Phab:D3966. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13391#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13391: PolyKinds is more permissive in GHC 8
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.2
Resolution: | Keywords: TypeInType
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC accepts | Unknown/Multiple
invalid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3859
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13391: PolyKinds is more permissive in GHC 8
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.2
Resolution: | Keywords: TypeInType
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC accepts | Unknown/Multiple
invalid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3859
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#13391: PolyKinds is more permissive in GHC 8 -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: fixed | Keywords: TypeInType Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | polykinds/T13391{,a} Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3859 Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: patch => closed * testcase: => polykinds/T13391{,a} * resolution: => fixed Comment: I don't think this should be merged. It's not ruining anyone's day, and it will cause fewer programs to be accepted. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13391#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC