Safe Haskell | None |
---|---|
Language | Haskell2010 |
Future values (values that can only be set once)
Synopsis
- data Future a
- data FutureSource a
- newFuture :: STM (Future a, FutureSource a)
- newFutureIO :: MonadIO m => m (Future a, FutureSource a)
- waitFuture :: Future a -> STM a
- pollFuture :: Future a -> STM (Maybe a)
- pollFutureIO :: MonadIO m => Future a -> m (Maybe a)
- setFuture :: a -> FutureSource a -> STM ()
- setFutureIO :: MonadIO m => a -> FutureSource a -> m ()
- setFuture' :: a -> FutureSource a -> STM Bool
Documentation
data FutureSource a Source #
Setter for a future value
newFutureIO :: MonadIO m => m (Future a, FutureSource a) Source #
waitFuture :: Future a -> STM a Source #
Wait for a future
pollFutureIO :: MonadIO m => Future a -> m (Maybe a) Source #
pollFuture
in IO
setFuture :: a -> FutureSource a -> STM () Source #
Set a future
setFutureIO :: MonadIO m => a -> FutureSource a -> m () Source #
Set a future in IO
setFuture' :: a -> FutureSource a -> STM Bool Source #
Set a future
Return False if it has already been set