Modify the contents of a
MutVar#, returning the previous
contents and the result of applying the given function to the previous
contents. Note that this isn't strictly speaking the correct type for
this function; it should really be
MutVar# s a -> (a
-> (a,b)) -> State# s -> (# State# s, a, (a, b)
#), but we don't know about pairs here.
Warning: this can fail with an unchecked exception.