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 dot strat. Specifically,
rpar dot strat always sparks a computation to reduce
the result of the strategic computation to WHNF, while
rparWith
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.