We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b10871b commit 9448549Copy full SHA for 9448549
MonadExample/gcd.hs
@@ -40,3 +40,4 @@ output = mapM_ putStrLn . fromDiffList. snd . runWriter . finalCountDown
40
41
output2 :: Int -> IO ()
42
output2 = mapM_ putStrLn . snd . runWriter . finalCountDown'
43
+
MonadExample/stack.hs
@@ -3,13 +3,14 @@ import Control.Monad.State
3
type Stack = [Int]
4
5
pop :: State Stack Int
6
-pop = State $ \(x:xs) -> (x,xs)
+pop = state $ \(x:xs) -> (x,xs)
7
8
push :: Int -> State Stack ()
9
-push a = State $ \xs -> ((), a:xs)
+push a = state $ \xs -> ((), a:xs)
10
11
stackMainip :: State Stack Int
12
stackMainip = do
13
push 3
14
- pop
+ push 4
15
+ push 5
16
pop
0 commit comments