[Haskell-beginners] Global variables
gtener at gmail.com
Wed Jun 29 17:42:39 CEST 2011
You can store IORef / MVar / whatever in the environment. The counter is
supposed to be global, so it should work for multiple threads.
On Wed, Jun 29, 2011 at 17:27, Christopher Done <chrisdone at googlemail.com>wrote:
> On 29 June 2011 17:22, Michael Xavier <nemesisdesign at gmail.com> wrote:
> > I tend to use Control.Monad.Reader for stateful stuff like this. It is
> > in the mtl package
> > http://hackage.haskell.org/package/mtl-220.127.116.11
> How would you use reader for a counter?
> Beginners mailing list
> Beginners at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners