[GHC] #11642: Heterogeneous type equality evidence ignored

GHC ghc-devs at haskell.org
Thu Feb 25 22:46:21 UTC 2016


#11642: Heterogeneous type equality evidence ignored
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.0.1
       Component:  Compiler (Type    |              Version:  7.10.3
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 Oddly enough, if I ask for the same wanted in a slightly more direct way,
 things work,
 {{{#!hs
 data IsFunc' a b where
   IsFunc' :: forall x y a b (f :: x -> y).
              IsFunc' (TypeRep f) (TypeRep x)

 buildApp :: forall k. forall (a :: k) b.
             TypeRep a -> TypeRep b -> IsFunc' (TypeRep a) (TypeRep b)
 buildApp f x =
   case typeRepKind f of
     TypeApp (TypeApp ty arg) res ->
       case eqTypeRep trArrow ty of
         Just HRefl ->
           case eqTypeRep arg x of
             Just HRefl ->
               IsFunc'
 }}}

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


More information about the ghc-tickets mailing list