-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple and fast implementation of Future -- -- Simple and fast implementation of Future @package futures @version 0.1 module Futures -- | Abstraction over a pattern where you delegate an IO action to be -- executed on another thread, but are still interested in processing its -- result some time later on. In the meantime you can execute other -- actions. IOW, it is an implementation of asynchronous programming -- pattern. -- -- Another way to look at future is as on an evaluate-once computation. data Future a -- | Fork a thread to execute the computation on and produce a future, -- which will provide its results. -- -- The IO action must not throw exceptions! If you want to transfer them, -- wrap it in try. fork :: IO a -> IO (Future a) -- | Block waiting until the future result is available. block :: Future a -> IO a instance Control.Monad.Fail.MonadFail Futures.Future instance Control.Monad.IO.Class.MonadIO Futures.Future instance GHC.Base.Monad Futures.Future instance GHC.Base.Applicative Futures.Future instance GHC.Base.Functor Futures.Future