title: Controlling parallel execution
body: <p>Haskell provides a <code>par</code> combinator, which queues a "spark" for <em>possible</em> evaluation in parallel with the current thread. It also provides a <code>pseq</code> combinator, which forces evaluation of pure code to occur in a specific order.</p>
  
  <p>What Haskell does <em>not</em> appear to provide is a way to generate several sparks and then <em>wait</em> for them all to finish. This is quite trivial to achieve with explicit concurrency, but appears to be impossible with pure sparks.</p>
  
  <p>In part, this is perhaps because of the intended use-case for sparks. They appear to be designed for <em>speculative</em> evaluation. That is, doing work which <em>might</em> be needed, but might not be. Hence, sparks only run on cores which are otherwise idle.</p>
  
  <p>However, this is not my use-case. I have a bunch of results which I <em>know</em>, for a fact, will be needed soon. And if I start trying to process the results before the sparks have fired, I'll just end up single-threaded again with a bunch of fizzled sparks.</p>
  
  <p>Of course, of <code>par</code> <em>waited</em> for sparks to complete, it wouldn't achieve any parallelism! But it would be really useful if there were some way to produce <em>several</em> sparks and then wait for them all to finish. I can't find any way to do that though.</p>
  
  <p>Does anybody have any useful suggestions? (Other than "use explicit concurrency", obviously.)</p>