[GHC] #16334: Named wildcards in kinds

GHC ghc-devs at haskell.org
Mon Feb 18 16:37:35 UTC 2019


#16334: Named wildcards in kinds
-------------------------------------+-------------------------------------
        Reporter:  int-index         |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.4.4
  checker)                           |             Keywords:
      Resolution:                    |  PartialTypeSignatures
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:                    |  https://gitlab.haskell.org/ghc/ghc/merge_requests/361
-------------------------------------+-------------------------------------
Changes (by int-index):

 * status:  new => patch
 * differential:   => https://gitlab.haskell.org/ghc/ghc/merge_requests/361


Old description:

> This works:
>
> {{{
> Prelude> :set -XNamedWildCards -XPartialTypeSignatures -XPolyKinds
> Prelude> k :: (Int :: _); k = 42
>
> <interactive>:2:14: warning: [-Wpartial-type-signatures]
>     • Found type wildcard ‘_’ standing for ‘*’
>     • In the type signature: k :: (Int :: _)
> }}}
>
> And this doesn't:
>
> {{{
> Prelude> k :: (Int :: _t); k = 42
>
> <interactive>:3:7: error:
>     • Expected kind ‘_t’, but ‘Int’ has kind ‘*’
>     • In the type signature: k :: (Int :: _t)
> }}}
>
> The issue, I suspect, is in `partition_nwcs`, which ignores kind
> variables for some reason. I plan to fix it as part of
> https://gitlab.haskell.org/ghc/ghc/merge_requests/361

New description:

 This works:

 {{{
 Prelude> :set -XNamedWildCards -XPartialTypeSignatures -XPolyKinds
 Prelude> k :: (Int :: _); k = 42

 <interactive>:2:14: warning: [-Wpartial-type-signatures]
     • Found type wildcard ‘_’ standing for ‘*’
     • In the type signature: k :: (Int :: _)
 }}}

 And this doesn't:

 {{{
 Prelude> k :: (Int :: _t); k = 42

 <interactive>:3:7: error:
     • Expected kind ‘_t’, but ‘Int’ has kind ‘*’
     • In the type signature: k :: (Int :: _t)
 }}}

 The issue, I suspect, is in `partition_nwcs`, which ignores kind variables
 for some reason.

--

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16334#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list