Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Similar to async package, however, suitable for manual threading and go without exceptions.
- data Progress a b
- newtype Future a b = Future {}
- type Future' = Future String
- forceFuture :: Future a b -> ([a] -> IO b) -> IO b
- waitFuture :: Future a b -> IO (Progress [a] b)
- maybeChance :: Future a b -> ([a] -> IO b) -> IO (Maybe b)
- eitherChance :: Future a b -> IO (Progress [a] b)
- asyncIO :: ((Progress [a] b -> IO ()) -> IO ()) -> IO (Future a b)
- runAction :: Future a (IO b) -> IO ()
Documentation
Two kinds of future is possible: (i) A pile of failures [a] and (ii) Successful result b.
Alternative (Future a) | |
Monad (Future a) | |
Functor (Future a) | |
Applicative (Future a) |
forceFuture :: Future a b -> ([a] -> IO b) -> IO b Source
Wait until future comes, and modify failure history.
waitFuture :: Future a b -> IO (Progress [a] b) Source
Just wait for the future honestly.
maybeChance :: Future a b -> ([a] -> IO b) -> IO (Maybe b) Source
Return Just
when it is time. The history may be modified.
eitherChance :: Future a b -> IO (Progress [a] b) Source
If it is too early, immediately returns Making
.