Re: Optimization of IORefs and STRefs - comparison to g++

2015-12-11 Thread Akio Takano
Hi Mateusz, IORef and STRef are boxed references. That is, they are a mutable cell that contains a pointer to some immutable Haskell value. When you increment a (STRef Int), you first dereference the pointer, allocate a new immutable heap object to represent the new integer value, then mutate the

Re: Optimization of IORefs and STRefs - comparison to g++

2015-12-11 Thread Michael Snoyman
My mutable-containers package has unboxed and storable references actually. On Fri, Dec 11, 2015, 12:26 PM Akio Takano wrote: > Hi Mateusz, > > IORef and STRef are boxed references. That is, they are a mutable cell > that contains a pointer to some immutable Haskell value.