Closed gilesbradshaw closed 1 year ago
Is your content edit request related to a problem? Please describe.
Some of the state monad stuff doesnlt comiple as State is not exported from Control.Monad.State
Describe the solution you'd like state in lower case:
type Stack = [Int] pop :: State Stack Int pop = state $ \(x:xs) -> (x,xs) push :: Int -> State Stack () push a = state $ \xs -> ((),a:xs)
Additional context
https://stackoverflow.com/questions/9697980/the-state-monad-and-learnyouahaskell-com Link to the page in question
https://learnyouahaskell.github.io/for-a-few-monads-more.html#state
Duplicate of #7.
Is your content edit request related to a problem? Please describe.
Some of the state monad stuff doesnlt comiple as State is not exported from Control.Monad.State
Describe the solution you'd like state in lower case:
Additional context
https://stackoverflow.com/questions/9697980/the-state-monad-and-learnyouahaskell-com Link to the page in question
https://learnyouahaskell.github.io/for-a-few-monads-more.html#state