[GHC] #14247: Fails to coerce between newtypes directly

GHC ghc-devs at haskell.org
Tue Sep 19 00:09:08 UTC 2017


#14247: Fails to coerce between newtypes directly
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 It's artificial and follows from me discussing "deriving via a `newtype`"
 with Ryan; we wondered if there could be a way to derive via a regular
 `data` type.. which lead me to something like

 {{{#!hs
 newtype W a = W a
 data    A   = MkA (W A)
 }}}

 where coercing `coerce :: A -> W A` actually works: make `A` a `newtype`
 and it stops working.

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


More information about the ghc-tickets mailing list