[Haskell-cafe] Generate random UArray in constant memory space.

Felipe Lessa felipe.lessa at gmail.com
Tue Feb 9 20:04:01 EST 2010

On Tue, Feb 09, 2010 at 04:27:57PM -0800, Bryan O'Sullivan wrote:
> It creates and returns a vector, so if you ask it to give you a billion
> items, it's going to require north of 8 gigabytes of memory. This should not
> come as a surprise, I'd hope :-)  Assuming that's not what you actually
> want, you should look at other entry points in the API, which you can use to
> generate a single value at a time in constant space.

He thought the vector would be fused away by the library, which
is one of the selling points of uvector.  Sadly the
implementation of uniformArray wasn't done with this purpose in


More information about the Haskell-Cafe mailing list