
9 Dec
2009
9 Dec
'09
10:07 p.m.
On Wed, Dec 9, 2009 at 3:44 PM, Mario Blazevic
I can't test it right now, but wouldn't the following do the job in the Identity monad?
forkExec :: Identity a -> Identity (Identity a) forkExec k = let result = runIdentity k in result `par` return (Identity result)
Since Identity is a newtype, would that be equivalent to "result `par` result"? The forkExec in the IO monad let's other computations keep going until I need the result from the forked computation. In a pure computation, I can already get the same result with `par` and laziness, right? Antoine