RxHaskell-0.2: Reactive Extensions for Haskell

Safe HaskellSafe

Signal.Operators

Synopsis

Documentation

doEvent :: Scheduler s => Signal s v -> (Event v -> SchedulerIO s ()) -> Signal s vSource

Runs a side-effecting action whenever the signal sends an event.

doNext :: Scheduler s => Signal s v -> (v -> SchedulerIO s ()) -> Signal s vSource

Runs a side-effecting action whenever the signal sends a value.

doError :: Scheduler s => Signal s v -> (IOException -> SchedulerIO s ()) -> Signal s vSource

Runs a side-effecting action whenever the signal sends an error.

doCompleted :: Scheduler s => Signal s v -> SchedulerIO s () -> Signal s vSource

Runs a side-effecting action when the signal completes.

finally :: Scheduler s => Signal s v -> SchedulerIO s () -> Signal s vSource

Runs a side-effecting action when the signal completes or errors.

materialize :: Scheduler s => Signal s v -> Signal s (Event v)Source

Brings every signal event into the monad, as a NextEvent containing the event itself.

dematerialize :: Scheduler s => Signal s (Event v) -> Signal s vSource

The inverse of materialize.

fromFoldable :: (Foldable t, Scheduler s) => t v -> Signal s vSource

Turns any Foldable into a signal.

map :: Scheduler s => Signal s v -> (v -> w) -> Signal s wSource

Returns a signal of mapped values.

filter :: Scheduler s => Signal s v -> (v -> Bool) -> Signal s vSource

Filters the values of a signal according to a predicate.

take :: (Integral n, Scheduler s) => Signal s v -> n -> Signal s vSource

Returns a signal of the first n elements.

drop :: (Integral n, Scheduler s) => Signal s v -> n -> Signal s vSource

Returns a signal without the first n elements.

switch :: forall s v. Scheduler s => Signal s (Signal s v) -> Signal s vSource

Returns a signal that sends the values from the most recently sent signal.

combine :: forall a b s. Scheduler s => Signal s a -> Signal s b -> Signal s (a, b)Source

Combines the latest values sent by both signals.

never :: Scheduler s => Signal s vSource

Returns a signal which never sends any events.

empty :: Scheduler s => Signal s vSource

Returns a signal which immediately completes.

data Signal s v Source

A signal which will send values of type v on a scheduler of type s.