[GHC] #11719: Cannot use higher-rank kinds with type families

GHC ghc-devs at haskell.org
Fri Mar 18 11:19:26 UTC 2016


#11719: Cannot use higher-rank kinds with type families
-------------------------------------+-------------------------------------
           Reporter:  ocharles       |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1-rc2
  (Type checker)                     |
           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:
-------------------------------------+-------------------------------------
 This ticket came out of a discussion with Richard in this mailing list
 post: https://mail.haskell.org/pipermail/haskell-
 cafe/2016-March/123462.html

 Here's the code that should work, but doesn't:

 {{{
 import Data.Kind

 data TyFun :: * -> * -> *
 type a ~> b = TyFun a b -> *

 type family (f :: a ~> b) @@ (x :: a) :: b

 data Null a = Nullable a | NotNullable a

 type family ((f :: b ~> c) ∘ (g :: a ~> b)) (x :: a) :: c where
   (f ∘ g) x = f @@ (g @@ x)

 type family BaseType (k :: forall a. a ~> Type) (x :: b) :: Type where
 -- this fails :(
 --  BaseType k x = (@@) k x
 }}}

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


More information about the ghc-tickets mailing list