Comment on OCaml for HaskellersparentComments−yummyfajitas15yYou can cheat in haskell as well. You can store the mutable variable in an mvar and then use unsafePerformIO (modifyMVar action) . It's uglier, but on the other hand the unsafeness of it jumps out at you.−jrockway15yMVars are for sharing data between threads. IORefs are mutable boxes.
Comments
You can cheat in haskell as well. You can store the mutable variable in an mvar and then use unsafePerformIO (modifyMVar action) . It's uglier, but on the other hand the unsafeness of it jumps out at you.
MVars are for sharing data between threads. IORefs are mutable boxes.