Problem : switching flows is currently possible with ap/?! but the behavior is discrete and eager, which is not always what we want.
Solution : provide a new macro cp (continuous process) returning a continuous flow, with ?! available as a forking operator. Like in ap, ?! runs provided flow, forks current computation and cancels previous branch for each successive value, but each branch is run lazily.
Problem : switching flows is currently possible with
ap
/?!
but the behavior is discrete and eager, which is not always what we want.Solution : provide a new macro
cp
(continuous process) returning a continuous flow, with?!
available as a forking operator. Like inap
,?!
runs provided flow, forks current computation and cancels previous branch for each successive value, but each branch is run lazily.Example :