3 ms·
Unless the list elements can be thunks that can be evaluated when necessary or appropriate. See for instance Control.Parallel.Strategies in Haskell, which provi
by danieldk 16y ago
Unless the list elements can be thunks that can be evaluated when necessary or appropriate. See for instance Control.Parallel.Strategies in Haskell, which provides amongst others 'parMap' (parallel mapping over lists).
- eru 16y agoEven then it's not enough. The problem is that the structure of a list is itself linear. Guy Steele had a nice talk about that. (This only bites you when your lists get long.)
- danieldk 16y agoI think that's a too blanket statement. What do you want to do with the list, a map or a fold? In the former case, what is the cost of the function application?
- eru 16y agoPlease have a look at Guy Steele's talk (http://www.vimeo.com/6624203 http://www.vimeo.com/6624203). Basically he suggests using tree-like data structures, instead of linear data structures. You can also map, fold and filter over trees, but it parallelizes better.