You're right that withValue appears to be quite unsafe. Which surprises me, given Mutex uses the same formulation. Not sure what's going on there, but it feels like a compiler bug — the supplied closure is not sending R.
You're right that withValue appears to be quite unsafe. Which surprises me, given Mutex uses the same formulation. Not sure what's going on there, but it feels like a compiler bug — the supplied closure is not sending R.