Safe Haskell | Safe |
---|
- data Command v
- data CommandPolicy
- newCommand :: CommandPolicy -> Signal MainScheduler Bool -> SchedulerIO MainScheduler (Command v)
- canExecute :: Command v -> Signal MainScheduler Bool
- executing :: Command v -> Signal MainScheduler Bool
- execute :: Command v -> v -> SchedulerIO MainScheduler Bool
- values :: Command v -> Signal MainScheduler v
- onExecute :: Command v -> (v -> Signal BackgroundScheduler ()) -> SchedulerIO MainScheduler (Signal MainScheduler (Signal BackgroundScheduler ()))
- errors :: Command v -> Signal MainScheduler IOException
- type Channel s v = (Subscriber s v, Signal s v)
- data Signal s v
- class Scheduler s
- data SchedulerIO s a
- data BackgroundScheduler
- data MainScheduler
Documentation
data CommandPolicy Source
Determines a command's behavior.
ExecuteSerially | The command can only be executed once at a time.
Attempts to |
ExecuteConcurrently | The command can be executed concurrently any number of times. |
:: CommandPolicy | Determines how the command behaves when asked to |
-> Signal MainScheduler Bool | A signal which sends whether the command should be enabled.
|
-> SchedulerIO MainScheduler (Command v) |
Creates a command.
canExecute :: Command v -> Signal MainScheduler BoolSource
Sends whether this command is able to execute.
This signal will always send at least one value immediately upon subscription.
executing :: Command v -> Signal MainScheduler BoolSource
Sends whether this command is currently executing.
This signal will always send at least one value immediately upon subscription.
:: Command v | The command to execute. |
-> v | A value to send to the command's subscribers. |
-> SchedulerIO MainScheduler Bool | Whether execution succeeded. This will be |
Attempts to execute a command.
:: Command v | The command to attach behavior to. |
-> (v -> Signal BackgroundScheduler ()) | A function which maps from the command's values to a signal of side-effecting work. |
-> SchedulerIO MainScheduler (Signal MainScheduler (Signal BackgroundScheduler ())) | A signal of the created signals. |
Creates a signal whenever the command executes, then subscribes to it.
errors :: Command v -> Signal MainScheduler IOExceptionSource
A signal of errors received from all signals created by onExecute
.
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.
A signal which will send values of type v
on a scheduler of type s
.
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 |
data BackgroundScheduler Source
A scheduler which runs enqueued actions in a dedicated background thread.
data MainScheduler Source
A scheduler which runs enqueued actions on the main thread.
Scheduler MainScheduler | |
Show v => Show (SchedulerIO MainScheduler v) | Unsafely executes a |