[Haskell-beginners] Global variables

Ertugrul Soeylemez es at ertes.de
Thu Jun 30 07:35:08 CEST 2011


Michael Snoyman <michael at snoyman.com> wrote:

> Though in this case, you can go with the cheaper IORef, since
> (presumably) the only operation is going to be incrementing the
> counter. Just be sure to use atomicModifyIORef[1].

I never recommend (or mention for that matter) IORefs in the beginner
list.  Also I think than an atomically modified IORef is not necessarily
faster.  TVars are optimized for that kind of operation.


Greets,
Ertugrul


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





More information about the Beginners mailing list