Safe Haskell | Safe |
---|
- data Signal s v
- signal :: Scheduler s => (Subscriber s v -> SchedulerIO s Disposable) -> Signal s v
- subscribe :: Scheduler s => Signal s v -> Subscriber s v -> SchedulerIO s Disposable
- (>>:) :: Scheduler s => Signal s v -> (Event v -> SchedulerIO s ()) -> SchedulerIO s Disposable
- never :: Scheduler s => Signal s v
- empty :: Scheduler s => Signal s v
- data Event v
- = NextEvent v
- | ErrorEvent IOException
- | CompletedEvent
- data Disposable
- class Scheduler s
- data SchedulerIO s a
Documentation
A signal which will send values of type v
on a scheduler of type s
.
:: Scheduler s | |
=> (Subscriber s v -> SchedulerIO s Disposable) | An action to run on each subscription. |
-> Signal s v | The constructed signal. |
Constructs a signal which sends its values to new subscribers synchronously.
:: Scheduler s | |
=> Signal s v | The signal to subscribe to. |
-> Subscriber s v | The subscriber to attach. |
-> SchedulerIO s Disposable | A disposable which can be used to terminate the subscription. |
Subscribes to a signal.
:: Scheduler s | |
=> Signal s v | The signal to subscribe to. |
-> (Event v -> SchedulerIO s ()) | An action to run when each event is received. |
-> SchedulerIO s Disposable | A disposable which can be used to terminate the subscription. |
Creates a subscriber and subscribes to the signal.
Represents an event that a signal might send.
Signals may send any number of NextEvent
s, followed by one ErrorEvent
or CompletedEvent
.
NextEvent v | A value |
ErrorEvent IOException | Sent when an error or exception occurs in the signal. Outside of the monad. |
CompletedEvent | Sent when the signal completes successfully. Outside of the monad. |
data Disposable Source
Allows disposal of a resource by running an action in the monad m
.
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
.
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 |