[GHC] #9163: Ptr should have a phantom role

GHC ghc-devs at haskell.org
Mon Jul 9 14:16:37 UTC 2018


#9163: Ptr should have a phantom role
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  7.10.1
       Component:  Compiler          |              Version:  7.8.2
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  roles/should_compile/Roles2
      Blocked By:                    |             Blocking:
 Related Tickets:  #9164             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dominic):

 I do feel strongly. From
 https://hackage.haskell.org/package/base-4.8.2.0/docs/Data-Coerce.html:
 "The function coerce allows you to safely convert between values of
 types". If the user has to know that the package they are using uses Ptr
 and thus avoid coerce then that seems to break the principle of
 abstraction. At least change the claim that coerce is type safe.

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


More information about the ghc-tickets mailing list