From fe3b3be6aceef78605f82a712c4aaba5f095e516 Mon Sep 17 00:00:00 2001 From: Joel Kaasinen Date: Fri, 1 Oct 2021 09:29:26 +0300 Subject: [PATCH] lecture 13: fix type of valuesAfterZero --- part2.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/part2.html b/part2.html index 34946f9..f5b5b34 100644 --- a/part2.html +++ b/part2.html @@ -3194,9 +3194,9 @@ this topic connects to equational reasoning discussed in chapter 10. remember :: a -> State [a] () remember x = modify (x:) -valuesAfterZero :: [Int] -> [Int] +valuesAfterZero :: [Int] -> ((),[Int]) valuesAfterZero xs = runState (go xs) [] - where go :: [a] -> State [a] () + where go :: [Int] -> State [Int] () go (0:y:xs) = do remember y go (y:xs) go (x:xs) = go xs