X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Control%2FParallel%2FStrategies.hs;h=ce3f7b08d52d30f927fc1f6321c33549ecbe60cc;hb=f8218e0dc6d2f354f89c1b4c0cc63f61844004c1;hp=294239bf0ae1c1c3f5b96ea2b8265a14f8e8c0b2;hpb=9ecf132d64d35e5997c12286f509b2f8d7f2a7ef;p=ghc-base.git diff --git a/Control/Parallel/Strategies.hs b/Control/Parallel/Strategies.hs index 294239b..ce3f7b0 100644 --- a/Control/Parallel/Strategies.hs +++ b/Control/Parallel/Strategies.hs @@ -362,8 +362,8 @@ parListN 0 strat xs = () parListN n strat (x:xs) = strat x `par` (parListN (n-1) strat xs) -- | Evaluates N elements of the spine of the argument list and applies --- `strat' to the Nth element (if there is one) in parallel with the --- result. e.g. parListNth 2 [e1, e2, e3] evaluates e2 +-- the given strategy to the Nth element (if there is one) in parallel with +-- the result. e.g. parListNth 2 [e1, e2, e3] evaluates e2 parListNth :: Int -> Strategy a -> Strategy [a] parListNth n strat xs | null rest = () @@ -379,13 +379,14 @@ parListChunk n strat xs = seqListN n strat xs `par` parListChunk n strat (drop n xs) -- | 'parMap' applies a function to each element of the argument list in --- parallel. The result of the function is evaluated using `strat' +-- parallel. The result of the function is evaluated using the given +-- strategy. parMap :: Strategy b -> (a -> b) -> [a] -> [b] parMap strat f xs = map f xs `using` parList strat -- | 'parFlatMap' uses 'parMap' to apply a list-valued function to each -- element of the argument list in parallel. The result of the function --- is evaluated using `strat' +-- is evaluated using the given strategy. parFlatMap :: Strategy [b] -> (a -> [b]) -> [a] -> [b] parFlatMap strat f xs = concat (parMap strat f xs) @@ -420,7 +421,7 @@ seqListNth n strat xs rest = drop n xs -- | Parallel n-buffer function added for the revised version of the strategies --- paper. 'parBuffer' supersedes the older 'fringeList'. It has the same +-- paper. 'parBuffer' supersedes the older @fringeList@. It has the same -- semantics. parBuffer :: Int -> Strategy a -> [a] -> [a] parBuffer n s xs =