3 ms·
"In pure FP, functions behavior depend only on its arguments, but it is not a requirement for DO (global variables are allowed in DO)." Do you mean global muta
by fulafel 6y ago
"In pure FP, functions behavior depend only on its arguments, but it is not a requirement for DO (global variables are allowed in DO)."
Do you mean global mutable state here, or constants? I think in Haskell and other pure FP languages it's common to declare things globally, but global mutable state is discouraged in many imperative programming cultures too. I guess in the gray area this leaves global state that is initialized once at runtime.
- viebel 6y agoI think that in pure FP, we tend to avoid global variables as much as we can, which is a good practice in general. What I meant is that DO is not opiniated regarding to global variables.
- tome 6y ago> I think that in pure FP, we tend to avoid global variables as much as we can, which is a good practice in general. Hmm, not really. Functions themselves are global variables!
- fulafel 6y agoA compile time immutable name binding is not a variable in the same sense as variables in proceudral programming. Just in the mathematical equation sense.