[GHC] #8090: MetaKinds - PolyKinds generalization

GHC ghc-devs at haskell.org
Fri Jul 26 00:47:54 CEST 2013


#8090: MetaKinds - PolyKinds generalization
-------------------------------------+------------------------------------
        Reporter:  wvv               |            Owner:
            Type:  feature request   |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.6.3
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by wvv):

 {{{
 True :: Bool :: * :: ** :: ***  :: **** :: ...
 }}}
 This is nice!

 ---

 Any rankNkinds is significant to work with rank(N-1)kinds data and classes
 only!

 'a' is exists anyway - this is exactly type.

 In {{{class Typeable3 (a :: ***) where ...}}} 'm' isn't significant at
 all. Is significant to type any rank2kinds data.

 But is significant in
 {{{

 foo :: (a :: (k :: (m :: ***))) -> (a :: (k :: (m :: ***))) -> b
 -- same first and second args

 class Foo (a :: (k :: (m :: ***))) where
    data Bar :: (m :: ***)
    data Baz :: (k :: **)
    ...

 }}}

 Let we have
 {{{
 data HomoCategory   a :: (k :: **) -> a :: (k :: **) -> * where ...
 data HeteroCategory (a :: **) -> (b :: **) -> * where ...

 class AnyCategory (a :: ***) where ...
 instance AnyCategory HomoCategory where ...
 instance AnyCategory HeteroCategory where ...
 }}}
 Nothing extraordinary is in the right, just Haskell:
 {{{
 class AnyCategory (a :: ***) where
    id :: (a :: ***) -> (a :: ***)
    id a = a
 }}}

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




More information about the ghc-tickets mailing list