As I see it, the point of using arrows isn’t to enable dynamic switching. The static nature of the Arrow
interface enables optimizing the computation ahead of running it (assuming the concrete type implementing the interface is concerned with this), and arrow-style feedback loops offer very concise management of local state.
The dynamic switch
at least as it is formulated in Yampa gives a Monad
-like interface on top of signal functions:
switch :: SF a (b, Event c) -> (c -> SF a b) -> SF a b
Much like Monad
, the dynamic nature of this gives maximum flexibility because the network structure can be reconfigured on the fly. This comes at a cost of not being able to optimize the whole network ahead of time though, which is something a more constrained framework like CCA is able to achieve.
While FRP without dynamic switching is not as powerful as FRP with dynamic switching by definition, there are many useful programs that can be expressed statically, especially when local state is so readily available.