[GHC] #7586: :kind command cannot show kind of type synonyms

#7586: :kind command cannot show kind of type synonyms -----------------------------+---------------------------------------------- Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.1 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- The following illustrates the problem: {{{ Prelude> type T a = Int Prelude> :k T <interactive>:1:1: Type synonym `T' should have 1 argument, but has been given none In a type in a GHCi command: T }}} Undoubtedly, T has a kind, and there's no reason to insist that the type given to the :kind command should be fully applied. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7586 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7586: :kind command cannot show kind of type synonyms ---------------------------------+------------------------------------------ Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by simonpj): * difficulty: => Unknown Comment: The `:kind` command takes a ''type'' not a ''name'' as its argument. So you can sy {{{ Prelude> :k [Int] }}} for example. would you expect this to work? {{{ Prelude> type T a b = Int Prelude> :k (Monad (T Int)) }}} Probably not. It's well-kinded but `T` is partially applied. OK, so how about this? {{{ Prelude> type T a b = Int Prelude> :k (T Int) }}} Now it's less obvious. Perhaps we should report `* -> *`, but it's clearly a hack ot do so. For the case you give where it's just a simple name, it is arguably really pedantic not to report the kind of the synonym. Really you should use `:info` when you just have a name. Suggestion: perhaps `:kind` (and `:type`), when applied to a name, should simply delegate to `:info`? Would that be better than some kind of hack to `:kind`? (Mind you `:info` is not printing nicely for polykinded things, yet.) Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7586#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7586: :kind command cannot show kind of type synonyms -------------------------------+-------------------------------------------- Reporter: augustss | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Resolution: wontfix | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by igloo): * status: new => closed * resolution: => wontfix Comment: I think that special casing `:kind` and `:type` when applied to names would be a bad idea. That magic will just cause even more confusion overall. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7586#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7586: :kind command cannot show kind of type synonyms -------------------------------+-------------------------------------------- Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Resolution: | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by simonpj): * status: closed => new * resolution: wontfix => Comment: I'm not convinced. It occurs to me that we could simply make `:kind` less picky about the types it is given; in particular, not check that synonyms are fully applied. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7586#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7586: :kind command cannot show kind of type synonyms
-------------------------------+--------------------------------------------
Reporter: augustss | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.1
Resolution: | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
-------------------------------+--------------------------------------------
Comment(by simonpj@…):
commit 46e204f7e0dc08a84a64ecc2fdaa9e3abef8438f
{{{
Author: Simon Peyton Jones

#7586: :kind command cannot show kind of type synonyms ---------------------------------+------------------------------------------ Reporter: augustss | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: ghci/scripts/T7586 | Blockedby: Blocking: | Related: ---------------------------------+------------------------------------------ Changes (by simonpj): * status: new => closed * testcase: => ghci/scripts/T7586 * resolution: => fixed Comment: OK I've done this. If everyone hates it we can back out, but I see Lennart's point exactly. (And `:info` doesn't actually display the kind either!) Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7586#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC