reactimate -package:rhine

Convenience function to run a signal function indefinitely, using a IO actions to obtain new input and process the output. This function first runs the initialization action, which provides the initial input for the signal transformer at time 0. Afterwards, an input sensing action is used to obtain new input (if any) and the time since the last iteration. The argument to the input sensing function indicates if it can block. If no new input is received, it is assumed to be the same as in the last iteration. After applying the signal function to the input, the actuation IO action is executed. The first argument indicates if the output has changed, the second gives the actual output). Actuation functions may choose to ignore the first argument altogether. This action should return True if the reactimation must stop, and False if it should continue. Note that this becomes the program's main loop, which makes using this function incompatible with GLUT, Gtk and other graphics libraries. It may also impose a sizeable constraint in larger projects in which different subparts run at different time steps. If you need to control the main loop yourself for these or other reasons, use reactInit and react.
Output. Execute the IO action whenever the event occurs. Note: If two events occur very close to each other, there is no guarantee that the reactimates for one event will have finished before the ones for the next event start executing. This does not affect the values of events and behaviors, it only means that the reactimate for different events may interleave. Fortunately, this is a very rare occurrence, and only happens if
  • you call an event handler from inside reactimate,
  • or you use concurrency.
In these cases, the reactimates follow the control flow of your event-based framework. Note: An event network essentially behaves like a single, huge callback function. The IO action are not run in a separate thread. The callback function will throw an exception if one of your IO actions does so as well. Your event-based framework will have to handle this situation.
Run an automaton with trivial input and output indefinitely. If the input and output of an automaton does not contain information, all of its meaning is in its effects. This function runs the automaton indefinitely. Since it will never return with a value, this function also has no output (its output is void). The only way it can return is if m includes some effect of termination, e.g. Maybe or Either could terminate with a Nothing or Left value, or IO can raise an exception.
Run a stream with trivial output. If the output of a stream does not contain information, all of its meaning is in its effects. This function runs the stream indefinitely. Since it will never return with a value, this function also has no output (its output is void). The only way it can return is if m includes some effect of termination, e.g. Maybe or Either could terminate with a Nothing or Left value, or IO can raise an exception.
Run a stream with trivial output. See reactimate.
Run an MSF indefinitely passing a unit-carrying input stream.
Output. Execute the IO action whenever the event occurs. This version of reactimate can deal with values obtained from the changes function.
reactimates an Automaton until it returns True.
reactimates an AutomatonExcept until it throws an exception.
reactimates an Automaton in the MaybeT monad until it throws Nothing.
Reactimates an MSF until it returns True.
Reactimates an MSFExcept until it throws an exception.
Reactimates an MSF in the MaybeT monad until it throws Nothing.