[Haskell-beginners] Global variables

Ertugrul Soeylemez es at ertes.de
Thu Jun 30 07:21:25 CEST 2011


Christopher Done <chrisdone at googlemail.com> wrote:

> > 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
>
> How would you use reader for a counter?

Reader is a good choice for an interthread counter:

    MonadIO m => ReaderT (TVar Int) m

I think, then people are talking about global variables in Haskell, what
they really want is such a thing.


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/





More information about the Beginners mailing list