[GHC] #14967: Optimizer Casting Caf with nominal type

GHC ghc-devs at haskell.org
Sat Mar 24 20:26:51 UTC 2018


#14967: Optimizer Casting Caf with nominal type
-------------------------------------+-------------------------------------
        Reporter:  etn               |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.4.1
      Resolution:                    |             Keywords:  coerce,
                                     |  nominal
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by etn):

 After looking for an example where this breaks without unsafe operations,
 I realized that this is almost certainly a safe transformation under the
 assumption of referential transparency. What this now amounts to is that
 there needs to be a way to prevent this from occurring in the case that a
 value cannot be shared between types. This issue came up when implementing
 Applicative, and I have realized that it is probably impossible to avoid
 this unless we can disable thunk-rewriting for particular thunks.

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


More information about the ghc-tickets mailing list