
Also I don't understand the API. What's unsafe about looking up a static
#12875: GHC fails to link all StaticPointers-defining modules of a library in an executable -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | StaticPointers 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 mboes): pointer? Surely we shouldn't be exposing low-level details like fingerprints? I think both of these points were already discussed in previous tickets (but I don't have pointers handy right now). The only lookup operation we have right now is one that doesn't check that you're looking up at the right type. That's because we don't yet store in the SPT what the type of the pointer really should be. As for fingerprints: an alternative is to expose {{{ serializeStaticPtr :: ... => StaticPtr a -> ByteString unserializeStaticPtr :: ... => ByteString -> StaticPtr a }}} As discussed, not a viable API, because then `base` depends on `bytestring`. That API would have the compiler make more assumptions than it needs to. With the current API the user has the freedom to serialize/deserialize in whatever way she wants (including e.g. integers created by a perfect hash function). IOW we try to bake into the compiler as little as possible, leaving the rest to implementation choices in "userland" libraries. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12875#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler