RxHaskell-0.2: Reactive Extensions for Haskell

Safe HaskellSafe

Signal.Connection

Synopsis

Documentation

data Connection s v Source

Multicasts a signal to many subscribers, without triggering any side effects more than once.

multicast :: Scheduler s => Signal s v -> Channel s v -> IO (Connection s v)Source

Creates a connection that will subscribe to the given base signal, and forward all events onto the given channel.

publish :: Scheduler s => Signal s v -> IO (Connection s v)Source

Multicasts to a simple channel.

connect :: forall s v. Scheduler s => Connection s v -> SchedulerIO s DisposableSource

Activates a connection by subscribing to its underlying signal. Calling this function multiple times just returns the existing disposable.

multicastedSignal :: Connection s v -> Signal s vSource

Returns the multicasted signal of a connection.

No events will be sent on the resulting signal until connect is invoked.

replay :: Scheduler s => Signal s v -> SchedulerIO s (Signal s v)Source

Multicasts to a replay channel of unlimited capacity, then connects immediately.

replayLast :: Scheduler s => Signal s v -> SchedulerIO s (Signal s v)Source

Multicasts to a replay channel of capacity 1, then connects immediately.

type Channel s v = (Subscriber s v, Signal s v)Source

A controllable signal, represented by a Subscriber and Signal pair.

Values sent to the subscriber will automatically be broadcast to all of the signal's subscribers. In effect, the subscriber is the write end, while the signal is the read end.

data Signal s v Source

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

class Scheduler s Source

Represents a queue of IO actions which can be executed in FIFO order.

data SchedulerIO s a Source

An IO computation that must be performed in a scheduler of type s.

Instances

Scheduler s => Monad (SchedulerIO s) 
Functor (SchedulerIO s) 
Scheduler s => Applicative (SchedulerIO s) 
Scheduler s => MonadIO (SchedulerIO s) 
Show v => Show (SchedulerIO BackgroundScheduler v) 
Show v => Show (SchedulerIO MainScheduler v)

Unsafely executes a SchedulerIO action and shows the result. This is for DEBUGGING PURPOSES ONLY.

data Disposable Source

Allows disposal of a resource by running an action in the monad m.

Instances