haskus-utils-0.8.0.0: Haskus utility modules

Safe HaskellNone
LanguageHaskell2010

Haskus.Utils.STM.Future

Description

Future values (values that can only be set once)

Synopsis

Documentation

data Future a Source #

Future value of type a

data FutureSource a Source #

Setter for a future value

newFuture :: STM (Future a, FutureSource a) Source #

Create a Future and its source

waitFuture :: Future a -> STM a Source #

Wait for a future

pollFuture :: Future a -> STM (Maybe a) Source #

Poll a future

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