Substitute State Using Functions With A State Monad
We take a closer look at the
get construction helper and see how we can use it to lift a function that maps the state portion and updates the resultant with the result. Using
get in this fashion, we then demonstrate how we can make accessors that can then be extended to create more complex interactions.
As there are times that we only want to pull the resultant for a given computation, we take a look at running our instances with the
evalWith will run our computations, throwing away the state, returning the resultant.