[GHC] #11760: runST with lazy blackholing breaks referential transparency
GHC
ghc-devs at haskell.org
Fri Apr 15 06:04:40 UTC 2016
#11760: runST with lazy blackholing breaks referential transparency
-------------------------------------+-------------------------------------
Reporter: Yuras | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect result | Unknown/Multiple
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by Yuras):
* failure: None/Unknown => Incorrect result at runtime
Comment:
Yes, I agree that it is specific to lazy `ST`. Strict one serializes
access to mutable refs, and entering the thunk twice just creates a fresh
set on refs.
Re performance in presence of `noDuplicate#`: I don't have a use case for
lazy `ST` actually, I just found the snippet on twitter. But it looks like
lazy `ST` is useless because of the issue, so probably trading performance
for correctness makes sense here.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11760#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list