Unsafe monads were already a thing in Haskell.
Sendable is just yet another monadic type, or a ML functor.
Sendable is just yet another monadic type, or a ML functor.
http://cml.cs.uchicago.edu/pages/sync-var.html
As for the rest I am on the go to type a proper example.
The purpose of the ST Monad is to prevent you form sharing the object inside it wrapped by an STRef with another thread of execution.
IORef utilizes the uniqueness of the ``IO`` monad and its properties guaranteed by the haskell runtime i.e. only one thread can use it at any given time to prevent more than one thread from having a reference to the object inside the IORef from multiple.
[1]:https://www.microsoft.com/en-us/research/wp-content/uploads/...