On Sun, Jan 30, 2011 at 1:42 AM, Daniel Peebles <[email protected]> wrote: > In a slightly related proposal on the same topic, what do people think of: > newArrayWith# :: (Int# -> a) -> Int# -> State# s -> (# State# s, > MutableArray# s a #) > > that would do the obvious thing, by allocating an array of the size > specified by the Int#, and then pass indices into the function to get > elements. This would again be to avoid the initialization cost for large > arrays, but provides a way more flexible interface than the clones (which > could be implemented in terms of it, but not as quickly).
If it's more efficient that newArray# followed by n writes, it could be a good addition. Johan _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
