[Haskell-cafe] How to use arrays efficiently?
Bulat Ziganshin
bulat.ziganshin at gmail.com
Fri May 16 09:57:28 EDT 2008
Hello Lauri,
Friday, May 16, 2008, 5:45:50 PM, you wrote:
> Yes, of course. How blind of me. Here is one more question.
> If you change IOUArray to IOArray and add $! in front of the two
> summations in the previous code, it still works correctly.
> But can you do similar trick with Array and accumArray? I have
> tried to put $! in different places in the first code that I posted but nothing seems to work.
accumArray internally uses more or less the same code with imperative
array as you wrote. so if you replace accumArray with your
implementation with all those $! - it will work. otherwise you just
don't get any chance :)
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Haskell-Cafe
mailing list