confusing:lyahpop
This is an old revision of the document!
pop is already a stateful computation and push takes an Int and returns a stateful computation. Now we can rewrite our previous example of pushing 3 onto the stack and then popping two numbers off like this:
<code >
import Control.Monad.State
stackManip :: State Stack Int
stackManip = do
push 3
a <- pop
pop
<>
You could leave a comment if you were logged in.
confusing/lyahpop.1616465417.txt.gz · Last modified: (external edit)
