[GHC] #12677: Type equality in constraint not used?

GHC ghc-devs at haskell.org
Sun Oct 9 23:54:15 UTC 2016


#12677: Type equality in constraint not used?
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           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:
-------------------------------------+-------------------------------------
 {{{#!hs
 data TyRep :: forall k. k -> Type where
   TyInt   :: TyRep Int
   TyBool  :: TyRep Bool
   TyMaybe :: TyRep Maybe
   TyApp   :: TyRep f -> TyRep x -> TyRep (f x)
 }}}

 This is allowed:

 {{{#!hs
 zero :: TypeRep (a :: Type) -> a
 zero = undefined
 }}}

 but this is not

 {{{#!hs
 zero :: Type ~ k => TyRep (a :: k) -> a
 zero = undefined

 zero :: TyRep (a :: k) -> Type ~ k => a
 zero = undefined
 }}}

 {{{
 tuHu.hs:20:35: error: …
     • Expected a type, but ‘a’ has kind ‘k’
     • In the type signature:
         zero :: Type ~ k => R (a :: k) -> a
 Compilation failed.
 }}}

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


More information about the ghc-tickets mailing list