Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- par :: a -> b -> b
- pseq :: a -> b -> b
- rpar :: Strategy a
- rparWith :: Strategy a -> Strategy a
- parEval :: Eval a -> Eval a
- parTraversable :: Traversable t => Strategy a -> Strategy (t a)
- parList :: Strategy a -> Strategy [a]
- parListChunk :: Int -> Strategy a -> Strategy [a]
- parMap :: Strategy b -> (a -> b) -> [a] -> [b]
- parTuple2 :: Strategy a -> Strategy b -> Strategy (a, b)
- parTuple3 :: Strategy a -> Strategy b -> Strategy c -> Strategy (a, b, c)
- parTuple4 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy (a, b, c, d)
- parTuple5 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy (a, b, c, d, e)
- parTuple6 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy f -> Strategy (a, b, c, d, e, f)
- parTuple7 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy f -> Strategy g -> Strategy (a, b, c, d, e, f, g)
- parTuple8 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy f -> Strategy g -> Strategy h -> Strategy (a, b, c, d, e, f, g, h)
- parTuple9 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy f -> Strategy g -> Strategy h -> Strategy i -> Strategy (a, b, c, d, e, f, g, h, i)
- module Eval
Documentation
rparWith :: Strategy a -> Strategy a #
Perform a computation in parallel using a strategy.
rparWith strat x
will spark strat x
. Note that rparWith strat
is not the
same as rpar
. Specifically, dot
stratrpar
always sparks a computation to reduce the result of the
strategic computation to WHNF, while dot
stratrparWith strat
need
not.
rparWith r0 = r0 rparWith rpar = rpar rparWith rseq = rpar
rparWith rpar x
creates a spark that immediately creates another
spark to evaluate x
. We consider this equivalent to rpar
because
there isn't any real additional parallelism. However, it is always
less efficient because there's a bit of extra work to create the
first (useless) spark. Similarly, rparWith r0
creates a spark
that does precisely nothing. No real parallelism is added, but there
is a bit of extra work to do nothing.
parEval
sparks the computation of its argument for evaluation in
parallel. Unlike
, rpar
. runEval
parEval
- does not exit the
Eval
monad - does not have a built-in
rseq
, so for example
behaves as you might expect (it creates a spark that does no evaluation).parEval
(r0
x)
It is related to rparWith
by the following equality:
parEval . strat = rparWith strat
parTraversable :: Traversable t => Strategy a -> Strategy (t a) #
Like evalTraversable
but evaluates all elements in parallel.
parList :: Strategy a -> Strategy [a] #
Evaluate each element of a list in parallel according to given strategy.
Equivalent to parTraversable
at the list type.
parListChunk :: Int -> Strategy a -> Strategy [a] #
Divides a list into chunks, and applies the strategy
to each chunk in parallel.evalList
strat
It is expected that this function will be replaced by a more generic clustering infrastructure in the future.
If the chunk size is 1 or less, parListChunk
is equivalent to
parList
parTuple5 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy (a, b, c, d, e) #
parTuple6 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy f -> Strategy (a, b, c, d, e, f) #
parTuple7 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy f -> Strategy g -> Strategy (a, b, c, d, e, f, g) #
parTuple8 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy f -> Strategy g -> Strategy h -> Strategy (a, b, c, d, e, f, g, h) #
parTuple9 :: Strategy a -> Strategy b -> Strategy c -> Strategy d -> Strategy e -> Strategy f -> Strategy g -> Strategy h -> Strategy i -> Strategy (a, b, c, d, e, f, g, h, i) #
Re-exports
module Eval