F# how to do List.map in parallel -


what lightweight, terse way run following code in parallel within standard f# libs? or failing used additional libs?

let newlist = oldlist |> list.map mycomplexfunction 

the best find

let newlist = oldlist |> list.map (fun x -> async { return mycomplexfunction x }                       |> async.parallel                        |> async.runsynchronously                       |> array.tolist 

i don't because it's 4 lines long , constructs array have make list. if working arrays simple, array.parallel, want keep lovely immutable list functional purity. can't believe there no list alternative, far have been unable find one. suggestions?

use pseq module:

open microsoft.fsharp.collections  let newlist =      oldlist      |> pseq.map mycomplexfunction     |> pseq.tolist 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -