
18 Jan
2014
18 Jan
'14
10:18 a.m.
I was wondering if a standard implementation of these helpers (or something similar) existed somewhere: startAsync :: IO a -> IO (MVar a) startAsync action = do var <- newEmptyMVar forkIO $ action >>= putMVar var return var wait :: MVar a -> IO a wait = readMVar I've found a few throwaway examples that implement something similar, and I can imagine some improvements already (I guess the MVar should be wrapped, for example, and some higher) but I was unable to find any released library that does something like this. Is it just too trivial for anyone to have bothered? -- mithrandi, i Ainil en-Balandor, a faer Ambar