[GHC] #9792: map/coerce rule never seems to fire

GHC ghc-devs at haskell.org
Tue Nov 11 15:20:06 UTC 2014


#9792: map/coerce rule never seems to fire
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:  ekmett
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:  7.10.1
             Component:  Core        |          Version:  7.9
  Libraries                          |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  Runtime     |  Related Tickets:
  performance bug                    |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Depends on the meaning of "guarantee". You're right in that `Coercible` is
 lifted and can therefore, in theory, contain ⊥. However, as I understand
 it, we do some work to avoid ever creating ⊥ here. This is why we track
 stack depths (or some such) in the solver, right? Another way to say this
 is that we've designed the solver to avoid creating a ⊥ `Coercible`. So,
 if by "guarantee", we mean "If GHC is a bug-free implementation of its
 specification, then there are no ⊥ `Coercible`s", I think we're close. I
 believe the situation here is very close to that of `~`, which is a lifted
 type but is supposedly never ⊥.

 We're not quite there because of deferred type errors, which surely can
 create ⊥ `Coercible`s. But I'm personally OK with wonky semantics in this
 case, if the wonky semantics means real-world speedups in the vastly more
 common no-deferred-type-errors case.

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


More information about the ghc-tickets mailing list