[GHC] #15192: Refactor of Coercion

GHC ghc-devs at haskell.org
Tue May 29 20:05:25 UTC 2018


#15192: Refactor of Coercion
-------------------------------------+-------------------------------------
        Reporter:  ningning          |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4747
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by goldfire):

 * cc: sweirich@… (added)


Comment:

 I agree with comment:5. Note that the new form is essentially a
 generalized form of `Refl`, which also has an unrestricted role parameter.

 One area where the new coercion form is simpler is when we need `t ~r (t
 |> g)`. Currently, this is `Sym (Coherence (Refl r t) g)`. The new form
 would be `EraseEqCo r t (CastTy t g) g`. I do suppose that, as sharing is
 destroyed, the new form could be worse than the original one.

 The truth is that Stephanie and I have been using this new form in our
 work for quite some time now, and this feels like just bringing GHC up to
 speed. But perhaps the old form is more convenient for implementation. I'd
 love to bring Stephanie in on the conversation.

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


More information about the ghc-tickets mailing list