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

GHC cvs-ghc at haskell.org
Fri Jan 18 19:04:50 CET 2013


#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



More information about the ghc-tickets mailing list