Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Signal a = Signal {}
- unsafeRef :: a -> IORef a
- unsafeRead :: IORef a -> a
- make :: a -> Signal a
- constant :: a -> Signal a
- merge :: Signal a -> Signal a -> Signal a
- mergeMany :: (Functor f, Foldable f) => f (Signal a) -> Maybe (Signal a)
- foldp :: (a -> b -> b) -> b -> Signal a -> Signal b
- sampleOn :: Signal a -> Signal b -> Signal b
- dropRepeats :: Eq a => Signal a -> Signal a
- runSignal :: Signal (IO ()) -> IO ()
- unwrap :: Signal (IO a) -> IO (Signal a)
- filter :: (a -> Bool) -> a -> Signal a -> Signal a
- filterMap :: (a -> Maybe b) -> b -> Signal a -> Signal b
- (~>) :: Signal a -> (a -> b) -> Signal b
Documentation
unsafeRead :: IORef a -> a Source #
merge :: Signal a -> Signal a -> Signal a Source #
Merge two signals, returning a new signal which will yield a value |whenever either of the input signals yield. Its initial value will be |that of the first signal.
foldp :: (a -> b -> b) -> b -> Signal a -> Signal b Source #
Creates a past dependent signal. The function argument takes the value of |the input signal, and the previous value of the output signal, to produce |the new value of the output signal.
sampleOn :: Signal a -> Signal b -> Signal b Source #
Creates a signal which yields the current value of the second signal every |time the first signal yields.
dropRepeats :: Eq a => Signal a -> Signal a Source #
Create a signal which only yields values which aren't equal to the previous |value of the input signal.
runSignal :: Signal (IO ()) -> IO () Source #
Given a signal of effects with no return value, run each effect as it |comes in.
unwrap :: Signal (IO a) -> IO (Signal a) Source #
Takes a signal of effects of a
, and produces an effect which returns a
|signal which will take each effect produced by the input signal, run it,
|and yield its returned value.
filter :: (a -> Bool) -> a -> Signal a -> Signal a Source #
Takes a signal and filters out yielded values for which the provided
|predicate function returns false
.