
6 Sep
2009
6 Sep
'09
11:36 a.m.
I just discovered that changing DiffArray to a plain Array improves performance of my code by almost a factor of 10. Bitten by DiffArray yet again! John -- this is no good, just change DiffArray to Array.
update :: (Char -> [Int]) -> DiffArray Int ModP -> Char -> DiffArray Int ModP update lookup arr c = arr // (map calc . lookup $ c) where calc i = (i, (arr ! i) + (arr ! (i-1)))