[GHC] #13131: add effectful version of atomicModifyMutVar#

#13131: add effectful version of atomicModifyMutVar# -------------------------------------+------------------------------------- Reporter: carter | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 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: -------------------------------------+------------------------------------- something like {{{ atomicEffectfulModifyMutVar# :: MutVar# s a -> ((# a, State# s #) -> (# State# s , a , b#)) -> State# s -> (#State# s, b #) }}} this isn't quite safely expressible currently without some unsafeCoercion highjinks that I'm not sure are robust -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13131 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13131: add effectful version of atomicModifyMutVar# -------------------------------------+------------------------------------- Reporter: carter | Owner: Type: feature request | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => infoneeded Comment: I don't understand what the semantics of this would be. How can you atomically update a `MutVar#` while allowing arbitrary side effects when computing the new value? The pure version works because we can speculatively create a thunk containing the old value in a compare-and-swap loop. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13131#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC