Looking for documentation on Control.Parallel.Strategies

Is there anything that documents this further than the Haddock documentation available from Haskell.org or the GHC pages? I've gotten some basic parallelism to work using parMap and using >|| and >|, but I had a fold and a map that I could logically compute at the same time. I found this example for quicksort using GPH: import Strategies main = print (quicksort ([999,998..0]::[Int])) quicksort :: (Ord a, NFData a) => [a] -> [a] quicksort [] = [] quicksort [x] = [x] quicksort (x:xs) = (lo ++ (x:hi)) `using` strategy where lo = quicksort [ y | y <- xs, y < x] hi = quicksort [ y | y <- xs, y >= x] strategy result = rnf lo `par` rnf hi `par` rnf result Is the syntax the same for GHC using Control.Parallel.Strategies? If so, does the following execute the two computations from the where clause in parallel? import Control.Parallel import Control.Parallel.Strategies stats bigList summation mean = (stddev, proportions) `using` strategy where stddev = sqrt (fold ((+) . (^2) . (-mean)) 0 bigList) proportions = map (/summation) bigList strategy result = rnf stddev >|| rnf proportions >|| rnf result Thanks! --Jeff

On Feb 16, 2007, at 21:16 , Jefferson Heard wrote:
Is there anything that documents this further than the Haddock documentation available from Haskell.org or the GHC pages? I've gotten some basic parallelism to work using parMap and using >|| and >|, but I had a fold and a map that I could logically compute at the same time.
...
Maybe that's what you're looking at, but the darcs version has some more Haddock comments, see http://www.haskell.org/ghc/dist/current/ docs/libraries/base/Control-Parallel-Strategies.html /Björn

That's MUCH better, thanks. That's not what's directly available from haskell.org. It still doesn't give anything more general about using the combinators in actual programs, you know, like examples, but it's at least some clear documentation as to what each strategy does. Maybe one day, when I have a parallel program actually working, I could document that... On Friday 16 February 2007 16:26, Bjorn Bringert wrote:
On Feb 16, 2007, at 21:16 , Jefferson Heard wrote:
Is there anything that documents this further than the Haddock documentation available from Haskell.org or the GHC pages? I've gotten some basic parallelism to work using parMap and using >|| and >|, but I had a fold and a map that I could logically compute at the same time.
...
Maybe that's what you're looking at, but the darcs version has some more Haddock comments, see http://www.haskell.org/ghc/dist/current/ docs/libraries/base/Control-Parallel-Strategies.html
/Björn

There is also an excellent paper in tutorial style which imho is very useful to understand the interaction of lazyness with the Control.Parallel.Strategies combinators: "Algorithm + Strategy = Parallelism" Philip W. Trinder, Kevin Hammond, Hans-Wolfgang Loidl, and Simon L. Peyton Jones. Journal of Functional Programming, 8(1), Jan 1998. http://www.macs.hw.ac.uk/~dsg/gph/papers/abstracts/strategies.html On 16/02/2007, at 22:44, Jefferson Heard wrote:
That's MUCH better, thanks. That's not what's directly available from haskell.org. It still doesn't give anything more general about using the combinators in actual programs, you know, like examples, but it's at least some clear documentation as to what each strategy does.
Maybe one day, when I have a parallel program actually working, I could document that...
On Friday 16 February 2007 16:26, Bjorn Bringert wrote:
On Feb 16, 2007, at 21:16 , Jefferson Heard wrote:
Is there anything that documents this further than the Haddock documentation available from Haskell.org or the GHC pages? I've gotten some basic parallelism to work using parMap and using >|| and >|, but I had a fold and a map that I could logically compute at the same time.
...
Maybe that's what you're looking at, but the darcs version has some more Haddock comments, see http://www.haskell.org/ghc/dist/current/ docs/libraries/base/Control-Parallel-Strategies.html
/Björn
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 16/02/07, Pepe Iborra
There is also an excellent paper in tutorial style which imho is very useful to understand the interaction of lazyness with the Control.Parallel.Strategies combinators:
"Algorithm + Strategy = Parallelism" Philip W. Trinder, Kevin Hammond, Hans-Wolfgang Loidl, and Simon L. Peyton Jones. Journal of Functional Programming, 8(1), Jan 1998. http://www.macs.hw.ac.uk/~dsg/gph/papers/abstracts/strategies.html
Indeed, it would be good if the new Haddock linked to this as well.
participants (4)
-
Bjorn Bringert
-
Cale Gibbard
-
Jefferson Heard
-
Pepe Iborra