Re: [Haskell-cafe] mutable arrays of tuples

2012-08-09 Thread Ketil Malde
David Feuer david.fe...@gmail.com writes:

 So I was thinking about a mutable array of tuples, but to avoid allocating
 tuples to modify their fields, I guess I really want an immutable array of
 tuples of STRefs. Just how much less efficient is this than a plain mutable
 array? might it even make sense to use parallel mutable arrays? The thought
 of that is disgusting to me, but at least one of the arrays could likely be
 made unboxed...

Maybe you could use a tuple of (unboxed) arrays instead?  Or if you use
Vector instead of Array, I think tuples are member of Unbox (as long as
the tuple elements are), and can be used directly in unboxed vectors.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] mutable arrays of tuples

2012-08-09 Thread Jake McArthur
In fact, unboxed arrays of tuples are represented in vector as tuples of
unboxed arrays.
On Aug 9, 2012 4:35 AM, Ketil Malde ke...@malde.org wrote:

 David Feuer david.fe...@gmail.com writes:

  So I was thinking about a mutable array of tuples, but to avoid
 allocating
  tuples to modify their fields, I guess I really want an immutable array
 of
  tuples of STRefs. Just how much less efficient is this than a plain
 mutable
  array? might it even make sense to use parallel mutable arrays? The
 thought
  of that is disgusting to me, but at least one of the arrays could likely
 be
  made unboxed...

 Maybe you could use a tuple of (unboxed) arrays instead?  Or if you use
 Vector instead of Array, I think tuples are member of Unbox (as long as
 the tuple elements are), and can be used directly in unboxed vectors.

 -k
 --
 If I haven't seen further, it is by standing in the footprints of giants

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe