
25 Jul
2009
25 Jul
'09
2:22 p.m.
Felipe wrote:
If you want variables in the impure sense, use IORefs.
import Data.IORef
...
a <- newIORef 0 onActivateLeaf menuAddOne $ do modifyIORef a (+1) print a
Hi Felipe, this works great except for the "print a" part which I replaced by: b <- readIORef a print b I should now have the tools to try to implement my real life problem. Thank you, Bernhard