2 ms·
It's not about monads as an abstract concept. It's specifically about the State monad. The key idea is that you can have something ressembling states with pure
by RandomThoughts3 2y ago
It's not about monads as an abstract concept. It's specifically about the State monad.
The key idea is that you can have something ressembling states with pure functions if you pass the a representation of the initial state as an argument and have the modified state be part of what the function return. You can then use this modified state as an argument for the next function call. The State monad is just an handy way to do this chaining.
But, yes, the actual state representation is in the way the argument is encoded, that's true.
Edit: I find it hilarious that I’m the one downvoted here while all the comments saying complete non sense about monads - including the ones clearly having no clue of what a monad actually is - are not. Never change HN.