[Haskell-cafe] Are storable-mutable-vectors in two dimensions possible in Haskell?

Fixie Fixie fixie.fixie at rocketmail.com
Sat Dec 1 12:10:52 CET 2012


Hello haskellers

I am struggling with this package: Data.Vector.Storable.Mutable

I am creating vectors like this: MV.new 1000 :: IO (V.MVector (PrimState IO) Int)

Now I would like access to this vectors in linear time, like I could have done in C using pointers.

The problem is that I do not know which datastructure to keep my vectors in. If I put them in a list, the access is very slow. Even a binary tree is very slow compared to a C-version.

I have tried to make an array og vector of storable-mutable vectors, but have not manged to accomplish this - even though there must be a haskell way :-)

Any clues?

Cheers,

Felix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121201/160f0d40/attachment.htm>


More information about the Haskell-Cafe mailing list