Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- nonBlocking :: Typeable b => Bool -> Cell IO a b -> Cell (HandlingStateT IO) (Maybe a) (Maybe b)
Documentation
:: Typeable b | |
=> Bool | Pass |
-> Cell IO a b | |
-> Cell (HandlingStateT IO) (Maybe a) (Maybe b) |
Wrap a cell in a non-blocking way.
Every incoming sample of nonBlocking cell
results in an immediate output,
either Just b
if the value was computed since the last poll,
or Nothing
if no new value was computed yet.
The resulting cell can be polled by sending Nothing
.
The boolean flag controls whether the current computation is aborted and restarted when new data arrives.