[GHC] #15535: Expose the StableName constructor
#15535: Expose the StableName constructor -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: 8.8.1 Component: Core | Version: 8.4.3 Libraries | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- A `StableName` is just a wrapper around `StableName#`, but we don't reveal that anywhere. That means that user code needs to use `unsafeCoerce` to convert between `StableName` and `StableName#`, which seems terrible. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15535> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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: | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: new => patch * differential: => Phab:D5078 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15535#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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 osa1): Out of curiosity, how do you coerce a `StableName` to a `StableName#`? `StableName` is a `data` so you'd have to first coerce it to constructor with one non-pointer field that is as large as a `StableName#`, and then read that field. Sounds tricky ... -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15535#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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
#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 David Feuer <David.Feuer@…>): In [changeset:"9c4e6c6b1affd410604f8f76ecf56abfcc5cccb6/ghc" 9c4e6c6/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="9c4e6c6b1affd410604f8f76ecf56abfcc5cccb6" Expose the StableName constructor * Move the definition of `StableName` from `System.Mem.StableName` to a new `GHC.StableName` module. * Expose the `StableName` data constructor from `GHC.StableName`. Once we have `UnliftedArray#`, this will enable `StableName`s to be stored in `UnliftedArray`s (from `primitive`) without unsafe coercions. Reviewers: hvr, bgamari, andrewthad, osa1 Reviewed By: osa1 Subscribers: osa1, rwbarton, carter GHC Trac Issues: #15535 Differential Revision: https://phabricator.haskell.org/D5078 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15535#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15535: Expose the StableName constructor -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: feature request | Status: merge 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: | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: patch => merge Comment: If it's not too late to merge this for 8.6, that'd be great. Otherwise, we can wait for 8.8. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15535#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15535: Expose the StableName constructor -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: feature request | Status: merge Priority: normal | Milestone: 8.6.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 bgamari): Yes, I suppose we can do this given that it only touches the `GHC` namespace. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15535#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15535: Expose the StableName constructor -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.6.1 Component: Core Libraries | Version: 8.4.3 Resolution: fixed | 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged in 768cc53d73e46954b01df69c6b215a41b3533f56. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15535#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC