[Haskell-cafe] Parallel executing of actions
Juan Carlos Arevalo Baeza
jcab.lists at jcabs-rumblings.com
Tue Apr 17 22:45:56 EDT 2007
:-) Thank you for your kindness. I mean... your frankness.
I had another issue in that code which clearly shows that I don't know
how to use parMap or strategies in general. Maybe this is better:
weirdParMap action = sequence_ . map action . parMap rwhnf (\x -> x `seq`
or maybe that's overkill and this is sufficient:
weirdParMap action = sequence_ . map action . parMap rwhnf id
weirdParMap action list = sequence_ $ map action (list `using` rnf)
(which I guess would require the appropriate NFData instanbe for the
or maybe I still don't know enough about this Parallel Haskell thingy.
In any case... couldn't something like this be what was needed in the
On Tue, 17 Apr 2007 17:56:27 -0700, Stefan O'Rear <stefanor at cox.net> wrote:
> On Tue, Apr 17, 2007 at 05:49:11PM -0700, Juan Carlos Arevalo Baeza
>> I may be talking out of my other end here, but... if you want
>> like parMap to calculate all the pixels in parallel, then... can't you
>> parMap itself?
>> Something like:
>> weirdParMap action = sequence_ . map action . parMap (id $!)
>> This evaluates all the elements of the list using parMap (the
>> part, right?), and then sequentially applies the action on the current
> You are. I'm devoting most of my brain cells to automatic deriving of
> TTypeable atm, but note that id is already strict, so (id $!) is
> equivalent to id.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe