Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data STMStream a
- readOne :: STMStream a -> IO (a, Maybe (STMStream a))
- readN :: Natural -> STMStream a -> IO [a]
- foldM :: STMStream a -> (a -> IO ()) -> IO () -> IO ()
- unfold :: forall a. Eq a => STM a -> STMStream a
- unfoldOn :: forall a b. Eq b => (a -> b) -> STM a -> STMStream a
- singleton :: STM a -> STMStream a
- dedupe :: forall a. Eq a => STMStream a -> STMStream a
Documentation
An STM stream of a
s (poor man's pull-based FRP)
readN :: Natural -> STMStream a -> IO [a] Source #
Read a number of events from the stream. Blocks until all events have been received.
:: STMStream a | The stream |
-> (a -> IO ()) | Event handler |
-> IO () | Handler for the end of the stream |
-> IO () |
Consume a stream. Blocks until the stream has terminated.
unfold :: forall a. Eq a => STM a -> STMStream a Source #
Produce an infinite stream of values from an STM (i.e. watch it for updates). Uses the Eq instance to not output the same value twice in a row.