Hey I’m down to party with some monads, but I leave that as an exercise to the reader.
One note: each variable only gets assigned to once, so FP won’t magic that away.
The side effects might have a different way of management in FP. But the IO will happen in the same order in reality anyway.
So I don’t think there’s a way out, but I honestly would be interested to see it.