I want to write a strategy for evaluating elements in an array in parallel. For old strategies it was parArrto do this ( see here ). But this is not found in the new Control.Parallel.Strategies module.
eg. parallel list score:map f myList `using` parList rdeepseq
I would like to be able to do something like:, amap f myArr `using` parArr rdeepseqwhere amap- from Data.Array.Base and apply a function to each of the elements (sequentially).
The following seems to work, but I wonder if this is being done correctly, and want to know how I can define my own parArr.
It works: amap ((+1) `using` rpar) $ Array.array (0,4) [(0,10),(1,20),(2,30),(3,40),(4,50)]
source
share