[GHC] #15535: Expose the StableName constructor

GHC ghc-devs at haskell.org
Mon Aug 20 07:27:27 UTC 2018


#15535: Expose the StableName constructor
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Core Libraries    |              Version:  8.4.3
      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:D5078
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Not tricky. Just gross.

 {{{#!hs
 data StableName_ a = StableName_ (StableName# a)

 unwrap :: StableName a -> StableName# a
 unwrap sn = case unsafeCoerce sn of
   StableName_ sn# -> sn#
 }}}

 And conversely.

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


More information about the ghc-tickets mailing list