modifyVar' :: Var a -> (a -> IO (a, b)) -> IO b
modifyVar_' :: Var a -> (a -> IO a) -> IO ()
writeVar' :: Var a -> a -> IO ()
All of which update the Var, and then, without the lock held, evaluate the a they just put inside the Var. CC @pepeiborra - does that sound plausible? I think that Ghcide having a custom Control.Concurrent.Strict wrapper that only exposes the strict variants is still likely to be useful for that project, but it could be done on top of those three.
See the diff at https://github.com/haskell/haskell-language-server/pull/1553. Inspired, but not directly following that code, my inclination would be:
All of which update the
Var
, and then, without the lock held, evaluate thea
they just put inside theVar
. CC @pepeiborra - does that sound plausible? I think that Ghcide having a custom Control.Concurrent.Strict wrapper that only exposes the strict variants is still likely to be useful for that project, but it could be done on top of those three.