You can store IORef / MVar / whatever in the environment. The counter is supposed to be global, so it should work for multiple threads.
On 29 June 2011 17:22, Michael Xavier <nemesisdesign@gmail.com> wrote:How would you use reader for a counter?
> I tend to use Control.Monad.Reader for stateful stuff like this. It is found
> in the mtl package
> http://hackage.haskell.org/package/mtl-2.0.1.0
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners