[GHC] #13337: GHC doesn't think a type is of kind *, despite having evidence for it

GHC ghc-devs at haskell.org
Sun Feb 26 17:16:15 UTC 2017


#13337: GHC doesn't think a type is of kind *, despite having evidence for it
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.2
  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 goldfire):

 The problem is that `a ~ b` is a ''lifted'' type. That is, it contains
 bottom. So, when you write `forall k (a :: k). k ~ Type => a -> a` or some
 such, there's no place to check whether the proof of `k ~ Type` is valid
 before you use it. When an expression intervenes, then GHC can insert a
 `case` to evaluate the equality proof box to find the real primitive
 (`~#`) equality inside.

 Some notes on this issue (intended solely as notes to self, so YMMV) are
 [https://ghc.haskell.org/trac/ghc/wiki/DependentHaskell/Internal#Liftedvs.Unliftedequality
 here].

 So I don't agree that solving (2) will help with (1) here.

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


More information about the ghc-tickets mailing list