[Haskell-cafe] MVar which can not be null ?

Roman Cheplyaka roma at ro-che.info
Mon Mar 18 08:15:35 CET 2013


* s9gf4ult <s9gf4ult at gmail.com> [2013-03-18 13:07:04+0600]
> Hello, I am looking for MVar which can not be null. I need some kind of
> thread save atomic IO operation like I can do 
> with modifyMVar, but I want this variable always contain some value and
> never be null.
> Thanks.

Wrap it into a newtype and export only those operations that keep it
non-empty.

Roman



More information about the Haskell-Cafe mailing list