FSMs are common in functional programs though possibly informally. The FSM itself is just a function of (st, event) -> (st, value). Or possibly a bunch of st -> (st, value) functions (where each function represents an event / transition).
It's a common informal way to integrate side-effects in a pure program, the impurity becomes an event or event-set over which the machine (usually composite) is integrated (via something like scan).
It's a common informal way to integrate side-effects in a pure program, the impurity becomes an event or event-set over which the machine (usually composite) is integrated (via something like scan).