spawn-0.1: Tiny library for joinable computations / threads with results.

Control.Concurrent.Spawn

Contents

Synopsis

Spawn

spawn :: IO a -> IO (IO a)Source

Spawn a concurrent computation. Produces an action which demands the result. Any exception from the original computation is re-thrown when and where the result is demanded.

Spawn with try

type Result a = Either SomeException aSource

Two ways a computation of type IO a can end.

spawnTry :: IO a -> IO (IO (Result a))Source

Spawn a concurrent computation. Produces an action which demands a Result.