Documentation

A simple reference type, hiding the complexity of all these type classes,
since most of the time the only thing you care about is that you want a reference.
The full complexity is still there, though, so FFI types or other reference-like
things can still be made into Refs.

Atomically modify the contents of a reference. This is
implemented in a separate class (rather than a function with
context (ReadRef sr m a, WriteRef sr m a)) because in most
cases the default implementation cannot act atomically.

Same thing, but don't thread out the extra return. Could perhaps
be implemented slightly more efficiently than atomicModifyReference in many cases.
Note that implementations are expected to be atomic, if at all possible,
but not strictly required to be.