In pure functional languages (at least in Elm), what happens is that you have data that describes what should be done, instead of doing it directly.
is talk called "Effects as Data" describing that idea: https://www.youtube.com/watch?v=6EdXaWfoslc
is talk called "Effects as Data" describing that idea: https://www.youtube.com/watch?v=6EdXaWfoslc
Separate the thing you want done from the doing it, because when you intermingle the doing-the-thing it greatly complications the scheduling logic. Think of it as a working programmers io monad.
I developed an open source game in Elm, and I've been very impressed with the benefits of the pure functional approach. It takes some getting used to, for sure, but it makes things really simple to reason about once you get used to it.
There are definitely rough edges still: Elm in particular is just missing a lot of stuff, but I was surprised how much value the pure functional approach gave me.