[GHC] #15273: Datatypes with CUSKs should quantify over unknown kinds
#15273: Datatypes with CUSKs should quantify over unknown kinds -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): Phab:D4845 | Wiki Page: -------------------------------------+------------------------------------- In [https://github.com/ghc-proposals/ghc-proposals/pull/54 the future], we will be able to give full kind signatures to datatype declarations. But in the present, we use CUSKs to write kind signatures. However, consider {{{#!hs data T (a :: Proxy k) }}} That has a CUSK, according to the CUSK rules. Yet we don't know the kind of `k`. Currently, this definition is rejected, accusing the user of lying about having a complete kind. However, let's instead pretend the user had written {{{#!hs type T :: Proxy k -> Type data T a }}} After all, that's what the CUSK is shorthand for. In this case, it's clear that we should infer `T :: forall k1 (k :: k1). Proxy k -> Type`, just the way we would do with a term-level type signature. This turns out to be quite easy. See Phab:D4845. This change allows strictly more programs to be accepted, and I think it falls under the threshold for requiring a proposal. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15273> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15273: Datatypes with CUSKs should quantify over unknown kinds -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4845 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Yes I agree. Trac #11648 is highly relevant. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15273#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15273: Datatypes with CUSKs should quantify over unknown kinds -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4845 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Richard Eisenberg <rae@…>): In [changeset:"12794287174146f982257cdeffd491e3e23838dc/ghc" 1279428/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="12794287174146f982257cdeffd491e3e23838dc" Quantify unfixed kind variables in CUSKs This is a small change in user-facing behavior. When we have a unification variable left over in a CUSK, we previously would issue an error. But, we can just quantify. This also teaches kcLHsQTyVars to use quantifyTyVars instead of its own, ad-hoc quantification scheme. Fixes #15273. test case: polykinds/T11648b }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15273#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15273: Datatypes with CUSKs should quantify over unknown kinds -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | polykinds/T11648b Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4845 Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => merge * testcase: => polykinds/T11648b Comment: I see no reason not to merge for 8.6. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15273#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15273: Datatypes with CUSKs should quantify over unknown kinds -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | polykinds/T11648b Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4845 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: merge => closed * resolution: => fixed * milestone: 8.8.1 => 8.6.1 Comment: Actually, this is present in the GHC 8.6 branch, so it //did// make it in. Closing. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15273#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC