How to work with global configuration variables (or files) in FP?

In a complex program in which I try to apply functional programming templates whenever I can, one problem is that many configuration files simply load and become global variables that are accessible externally in the program. This approach leads to confusion. How to handle configuration files in the style of functional programming?

+4
source share
1 answer

Modeling configuration variables as a function seems reasonable to me. What he does is that the function will be unclean and depends on the state, namely the configuration file.

+2

Source: https://habr.com/ru/post/1608293/


All Articles