Fwd: [Haskell-cafe] Boxed Mutable Arrays

Alberto G. Corona agocorona at gmail.com
Tue Dec 15 09:38:03 EST 2009


---------- Forwarded message ----------
From: Alberto G. Corona <agocorona at gmail.com>
Date: 2009/12/15
Subject: Re: [Haskell-cafe] Boxed Mutable Arrays
To: Daniel Peebles <pumpkingod at gmail.com>


Ok, so the state content is not accessible. Nice.

2009/12/15 Daniel Peebles <pumpkingod at gmail.com>

No, they are actually being mutated. ST is basically IO with a
> universal state thread (IO uses RealWorld) to prevent you from letting
> any of the mutable structures out (or any in) of the block. The whole
> point of ST is to have real mutable references/arrays that have a
> referentially transparent if you look at them from outside.
>
> Dan
>
> On Tue, Dec 15, 2009 at 9:23 AM, Alberto G. Corona <agocorona at gmail.com>
> wrote:
> > AFAIK, ST Arrays are pure data structures. They are not really mutable.
> They
> > are destroyed and recreated on every update. The mutation is just
> simulated
> > thanks to the hidden state in the state monad. Sure, the garbage
> collector
> > must have a hard work in recycling all the "backbones" of the discarded
> > arrays (not the elements).
> >
> > 2009/12/14 Brad Larsen <brad.larsen at gmail.com>
> >>
> >> Is anyone working on fixing ticket #650
> >> <http://hackage.haskell.org/trac/ghc/ticket/650>?  In short, STArray
> >> and the garbage collector don't play well together, resulting in array
> >> updates being non-constant time operations.  This bug makes it very
> >> difficult/impossible to write efficient array algorithms that depend
> >> upon mutation in Haskell.
> >>
> >> On another note, does this (or perhaps better phrased, will this) bug
> >> also affect Data Parallel Haskell?
> >>
> >> I would really like to see highly efficient, mutable, boxed arrays in
> >> Haskell!  Unfortunately, I don't have the know-how to fix Ticket 650.
> >>
> >> Sincerely,
> >> Brad
> >> _______________________________________________
> >> Haskell-Cafe mailing list
> >> Haskell-Cafe at haskell.org
> >> http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091215/f1c0eba5/attachment-0001.html


More information about the Haskell-Cafe mailing list