[GHC] #14265: kinded holes

#14265: kinded holes -------------------------------------+------------------------------------- Reporter: lspitzner | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 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: -------------------------------------+------------------------------------- For value-level holes, ghc kindly mentions the expected type. It does not do the same for holes in type signatures: mentioning the expected kind. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14265 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14265: kinded holes -------------------------------------+------------------------------------- Reporter: lspitzner | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.2.1 checker) | Keywords: Resolution: | PartialTypeSignatures Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => PartialTypeSignatures * component: Compiler => Compiler (Type checker) Comment: You didn't give a concrete example of what you'd like to see, so I'm forced to guess. My shot-in-the-dark attempt is this program: {{{#!hs {-# LANGUAGE PolyKinds #-} f :: proxy _ -> () f _ = () }}} {{{ GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug.hs, interpreted ) Bug.hs:3:12: error: • Found type wildcard ‘_’ standing for ‘w’ Where: ‘w’ is a rigid type variable bound by the inferred type of f :: proxy w -> () at Bug.hs:4:1-8 ‘k’ is a rigid type variable bound by the inferred type of f :: proxy w -> () at Bug.hs:4:1-8 To use the inferred type, enable PartialTypeSignatures • In the type signature: f :: proxy _ -> () | 3 | f :: proxy _ -> () | ^ }}} This output is indeed pretty skeevy-looking¸ since it points out a kind variable `k` in a `Where:` clause, but `k` isn't used anywhere else! Perhaps you wanted to see something like this instead? {{{ • Found type wildcard ‘_’ standing for ‘w’ (of kind ‘k’) Where: ... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14265#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14265: kinded holes -------------------------------------+------------------------------------- Reporter: lspitzner | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.2.1 checker) | Keywords: Resolution: | PartialTypeSignatures Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lspitzner): That is exactly what I meant. Polykinded was not even in my mind; it would not hurt to have the same in simpler (non-polykind) cases too, like {{{#!hs foo :: StateT _ _ (); foo = undefined }}} could produce {{{ <interactive>:7:15: error: • Found type wildcard ‘_’ standing for ‘w’ (of kind ‘*’) Where: ‘w’ is a rigid type variable bound by the inferred type of foo :: StateT w w1 () at <interactive>:7:23-37 To use the inferred type, enable PartialTypeSignatures • In the type signature: foo :: StateT _ _ () <interactive>:7:17: error: • Found type wildcard ‘_’ standing for ‘w1’ (of kind ‘* -> *’) … }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14265#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14265: kinded holes
-------------------------------------+-------------------------------------
Reporter: lspitzner | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.2.1
checker) | Keywords:
Resolution: | PartialTypeSignatures
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#14265: kinded holes -------------------------------------+------------------------------------- Reporter: lspitzner | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler (Type | Version: 8.2.1 checker) | Keywords: Resolution: fixed | PartialTypeSignatures Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14265#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14265: kinded holes -------------------------------------+------------------------------------- Reporter: lspitzner | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler (Type | Version: 8.2.1 checker) | Keywords: Resolution: fixed | PartialTypeSignatures Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lspitzner): thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14265#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14265: kinded holes -------------------------------------+------------------------------------- Reporter: lspitzner | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler (Type | Version: 8.2.1 checker) | Keywords: Resolution: fixed | PartialTypeSignatures Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | polykinds/T14265 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => polykinds/T14265 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14265#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC