Jul 15, 2022
The technique you are using here is called "partial application", where a function is executed and returns one or several functions that share access to the outer functions body and there-for state.
as I show in the following and other articles, partial application can be used to build systems of any complexity (so I use swift).