[GHC] #12045: Visible kind application

GHC ghc-devs at haskell.org
Wed May 11 15:20:03 UTC 2016


#12045: Visible kind application
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.1
           Keywords:                 |  Operating System:  Unknown/Multiple
  TypeApplications TypeInType        |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I've wanted this for a while

 {{{
 ghci> :kind (:~:)
 (:~:) :: k -> k -> Type
 }}}

 {{{
 ghci> :kind (:~:) @(Type -> Type)
 (:~:) @(Type -> Type) :: (Type -> Type) -> (Type -> Type) -> Type

 ghci> :kind (:~:) @(Type -> Type) []
 (:~:) @(Type -> Type) [] :: (Type -> Type) -> Type

 ghci> :kind (:~:) @(Type -> Type) [] Maybe
 (:~:) @(Type -> Type) [] Maybe :: Type
 }}}

 Working like

 {{{
 ghci> type Same k (a::k) (b::k) = a :~: b
 ghci> :kind Same
 Same :: forall k -> k -> k -> *
 }}}

 {{{
 ghci> :kind Same (Type -> Type)
 Same (Type -> Type) :: (Type -> Type) -> (Type -> Type) -> *
 ghci> :kind Same (Type -> Type) []
 Same (Type -> Type) [] :: (Type -> Type) -> *
 ghci> :kind Same (Type -> Type) [] Maybe
 Same (Type -> Type) [] Maybe :: *
 }}}

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


More information about the ghc-tickets mailing list