-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | realtime resource handling with manual concurrency -- @package future-resource @version 0.3.0.0 -- | Similar to async package, however, suitable for manual threading and -- go without exceptions. module Control.Future data Progress a b Making :: Progress a b Fixme :: a -> Progress a b Finished :: b -> Progress a b -- | Two kinds of future is possible: (i) A pile of failures [a] and (ii) -- Successful result b. newtype Future a b Future :: IO (Progress [a] b) -> Future a b runFuture :: Future a b -> IO (Progress [a] b) type Future' = Future String -- | Wait until future comes, and modify failure history. forceFuture :: Future a b -> ([a] -> IO b) -> IO b -- | Just wait for the future honestly. waitFuture :: Future a b -> IO (Progress [a] b) -- | Return Just when it is time. The history may be modified. maybeChance :: Future a b -> ([a] -> IO b) -> IO (Maybe b) -- | If it is too early, immediately returns Making. eitherChance :: Future a b -> IO (Progress [a] b) -- |
--   asyncIO $ \update -> forkIO (doSth >>= update)
--   
asyncIO :: ((Progress [a] b -> IO ()) -> IO ()) -> IO (Future a b) -- | Run an action created in given Future if it is available now. runAction :: Future a (IO b) -> IO () instance Functor (Progress a) instance (Show a, Show b) => Show (Progress a b) instance Monad (Future a) instance Alternative (Future a) instance Applicative (Future a) instance Functor (Future a)