[Haskell-cafe] Re: Parallel foldl doesn't work correctly

Ben Millwood haskell at benmachine.co.uk
Sat Dec 12 08:46:28 EST 2009

On Sat, Dec 12, 2009 at 10:08 AM, Maciej Piechotka
<uzytkownik2 at gmail.com> wrote:
> If operation is associative it can be done using divide et impera
> spliting list in half and operating on it pararerlly then split in half
> etc.

I implemented something like this as an exercise:


It took me a little while to get everything to par as it should and
I'm still not sure I'm doing it in the most efficient way, but there
it is.

(If the output is nonsense, you might try changing hPutStrLn stderr
into putStrLn so that it's buffered and arrives in blocks).

More information about the Haskell-Cafe mailing list