
29 Sep
2008
29 Sep
'08
4:55 a.m.
What is the reason for implementing parallelism with 'par :: a -> b -> b'? Analogy to 'seq'? I thought parallelism would be introduced most naturally by a function which does two computations in parallel and puts together their results after completion. Say
par2 :: (a -> b -> c) -> (a -> b -> c)
to be used like
par2 (+) expensiveComputationA expensiveComputationB
I assume that par2 can be implemented this way:
par2 f x y = f x (par x y)
?