[GHC] #11526: unsafeLookupStaticPtr should not live in IO
GHC
ghc-devs at haskell.org
Tue Feb 2 07:59:25 UTC 2016
#11526: unsafeLookupStaticPtr should not live in IO
-------------------------------------+-------------------------------------
Reporter: edsko | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1-rc1
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:
-------------------------------------+-------------------------------------
`GHC.StaticPtr` provides
{{{#!hs
unsafeLookupStaticPtr :: StaticKey -> IO (Maybe (StaticPtr a))
}}}
I don't think this function should live in IO. It is morally pure (the SPT
that it needs to access is static for the duration of the program after
all) and when this lives in IO this function cannot be used in `Binary`
instances (without using `unsafePerformIO`, obviously).
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11526>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list