switchE : MSF m i (Either e o) -> (e -> MSF m i o) -> MSF m i o Produces output of the first MSF until it produces
a `Left`, in which case the event will be used to
create a new MSF, which will be immediately evaluated
and used henceforth.
This is a one-time switch, which is often used to
run an MSF a fixed number of times or until a certain
event occurs, after which the replacement will be used.
Note: It is unsafe to use this in a recursive setting,
as it would allow us to create an infinite loop
of streaming functions, all of which return `Left`s
forever. Luckily, the totality checker will prevent us
from doing this.
Totality: total
Visibility: exportswitch : MSF m i (HList [o, Event e]) -> (e -> MSF m i o) -> MSF m i o Produces output of the given MSF until it fires an event,
in which case a new MSF is created,
which will be evaluated immediately and used henceforth.
This uses `switchE` internally, so all restrictions mentioned
there apply.
Totality: total
Visibility: exportdSwitch : MSF m i (HList [o, Event e]) -> (e -> MSF m i o) -> MSF m i o Produces output of the given MSF until it fires an event,
in which case a new MSF is created,
which will be used in all further evaluation steps.
Totality: total
Visibility: exportrSwitch : Monad m => MSF m i o -> MSF m (HList [Event (MSF m i o), i]) o- Totality: total
Visibility: export drSwitch : Monad m => MSF m i o -> MSF m (HList [Event (MSF m i o), i]) o- Totality: total
Visibility: export drswitchWhen : Monad m => MSF m i o -> MSF m i (Event e) -> (e -> MSF m i o) -> MSF m i o Produces output of the first MSF until the second
fires an event, in which case a new MSF is created,
which will be used in all futre evaluation cycles.
Totality: total
Visibility: export