Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-05-17 Thread Yves Parès
Hello all, By the way, is there any reason to prefer package 'vector' over package 'array'? Do they just provide different interfaces to similar functionnalities or are there real performance stakes? I personnaly prefer Data.Array, since: - It gives the possibility to index with something else

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-05-17 Thread Don Stewart
Yes, the differences between * vector * array * repa were discussed this week on Stack Overflow: http://stackoverflow.com/questions/6006304/what-haskell-representation-is-recommended-for-2d-unboxed-pixel-arrays-with-mill The reason to prefer vectors of arrays are: * flexible interface

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-05-17 Thread Felipe Almeida Lessa
On Tue, May 17, 2011 at 8:30 PM, Don Stewart don...@gmail.com wrote:  * vector  * array  * repa Don, do you think that repa is as recommended as vector for production applications? I'm asking so because it is my understanding that accelerate still isn't mature enough to be used in production

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-05-17 Thread Don Stewart
Well, repa doesn't have a GPU backend. So if you need GPU stuff, you probably do need to look at accelerate. I think Repa is in beta now, the API might change a little (e.g. we're discussing making the stuff under the hood Storable class friendly). It also only has a small number of users, while

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-04-24 Thread Gregory Collins
I also recently implemented a Fisher-Yates shuffle in mutable vectors. I probably should have used Gen (from mwc-random) in ST, but I already had a GenIO hanging around for other reasons. -- import

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-04-24 Thread Felipe Almeida Lessa
There is vector-algorithms [1] which has lots of mutable code. Note that it uses 'PrimMonad m = m ...', which means that the code may work on ST or IO. Cheers, [1] http://hackage.haskell.org/package/vector-algorithms -- Felipe. ___ Haskell-Cafe

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-04-23 Thread Globules
brad clawsie clawsie at fastmail.fm writes: hi all i was wondering if anyone could post some minimal examples on using mutable Vectors in the ST monad. i've been digging around in the usual places but haven't been able to find anything to get me over the hump thanks in advance brad

[Haskell-cafe] fishing for ST mutable Vector examples

2011-04-22 Thread brad clawsie
hi all i was wondering if anyone could post some minimal examples on using mutable Vectors in the ST monad. i've been digging around in the usual places but haven't been able to find anything to get me over the hump thanks in advance brad ___

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-04-22 Thread Don Stewart
In my tutorial on using vectors, http://www.haskell.org/haskellwiki/Numeric_Haskell:_A_Vector_Tutorial There's some examples: http://www.haskell.org/haskellwiki/Numeric_Haskell:_A_Vector_Tutorial#Impure_Arrays that work in IO, and should work equally well in ST (as vectors are parameterized by

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-04-22 Thread Stephen Tetley
Hi Brad I think all you can do with an ST array is covered by the MArray class and its derived operations - note the class is exported opaquely from Data.Array.MArray - it has these two members that aren't exported so aren't documented: unsafeRead :: Ix i = a i e - Int - m e unsafeWrite :: Ix

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-04-22 Thread Daniel Fischer
On Friday 22 April 2011 20:14:38, Stephen Tetley wrote: Hi Brad I think all you can do with an ST array is covered by the MArray class and its derived operations - note the class is exported opaquely from Data.Array.MArray - it has these two members that aren't exported so aren't