I am reading Monad tutorials, and the one I'm working on now is http://www.muitovar.com/monad/moncow.xhtml , but I ran further the Monad state problem, or rather, the accessStar runState function.
Type is defined as
newtype State sa = State { runState :: (s -> (a,s)) }
and it is called, for example.
runState (chncasewst3 'e' 'd' 'f') False
I don’t know how to read the definition to go to the second line, especially because of the “State sa” part. If this is where "State as", I can conclude that the accessory was "as far" as "s".
So the question is: how to read the type definition so that I can see how to call this function in this situation, and, if possible, how to read the access functions as such.
Masse source share