
18 Mar
2010
18 Mar
'10
5:36 p.m.
Daniel Fischer wrote:
If it's called often, and the arrays are 0-based and Int-indexed,
import Data.Array.Base (unsafeAt)
and replacing ! with `unsafeAt` should give a speed-up, though probably not terribly much. If you don't need the polymorphism and your array elements are unboxable, using UArray from Data.Array.Unboxed should be significantly faster.
Beware that unboxed arrays are strict, and changing the strictness properties of your code can have non-obvious consequences...