3 ms·
> In Java you'd say something like `this.getConfigBlah()` No, the whole point is that it’s completely dissimilar to that. > But does this have anything to do
by RandomThoughts3 2y ago
> In Java you'd say something like `this.getConfigBlah()`
No, the whole point is that it’s completely dissimilar to that.
> But does this have anything to do with monads or some monadic version of state?
There is no monadic version of state. The State monad is a way of chaining things together (not unlike shell pipes) which is nice in Haskell because it gives access to some of the language syntactic sugar (the do notation). There is nothing particularly special there otherwise.
The key takeaway here is that you can avoid littering your global scope by explicitly passing what’s shared as functions arguments and then remove side effects if you also pass by value.
Yes, it is this simple.