[Haskell-cafe] How to use arrays efficiently?

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri May 16 09:55:07 EDT 2008


Hello Ketil,

Friday, May 16, 2008, 5:27:29 PM, you wrote:

> I guess it would be possible to have UArray Int (# Double, Double,
> Double #) - packing all three Doubles unboxed into the array, but I've
> no clue how to go about automating that.

unoxed tuple doesn't have a box so it cannot be instance of typeclass.
actually, ordinary tuple will solve this problem unless one problem in
GHC - it's UArray indexing primitives use *element* indexes inatead of
*byte* indexes. although at least we can implement UArray ix (a,a),
UArray ix (a,a,a) and so on


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list