On Wed, Dec 9, 2009 at 3:44 PM, Mario Blazevic <mblaze...@stilo.com> wrote:
>
>        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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to