<div dir="ltr">  Dear Haskellers,<div><br></div><div>I&#39;ve been playing with par and pseq, and I wonder: Is there any reason to use</div><div>  a `par` b `pseq` (a + b)</div><div>instead of</div><div>  a `par` b `par` (a + b)</div>

<div>except that the second version sparks twice instead of just once (which probably degrades performance a bit)? It seems to me that the second variant would work as well: The main thread would block on one of the sparked computations, but the other one would still be evaluated in parallel.</div>

<div><br></div><div>The second variant seems to have one additional advantage: If the function that combines &#39;a&#39; and &#39;b&#39; isn&#39;t strict (and perhaps we don&#39;t know that in advance), the main thread won&#39;t be blocked by evaluating the computation it doesn&#39;t need. Like</div>

<div>    a `par` b `pseq` (const a b)</div><div>will block until both &#39;a&#39; and &#39;b&#39; are evaluated, but</div><div><div>  a `par` b `par` (const a b)</div></div><div>will finish as soon as &#39;a&#39; is evaluated.</div>

<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>I found this link on SO:</div><div>Why do we need &#39;seq&#39; or &#39;pseq&#39; with &#39;par&#39; in Haskell? &lt;<a href="http://stackoverflow.com/q/4576734/1333025">http://stackoverflow.com/q/4576734/1333025</a>&gt;</div>

<div>but it doesn&#39;t really solve this objection.</div><div><br></div><div>  Thanks for help,</div><div>  Petr Pudlak</div></div>