A more Julian way of doing this would be to parametrize the `State` type, and then split this function into two.  A "trick" is to note that you can parametrize on any `Integer` type, including `Bool`, so `doindent` would be a very natural type parameter.