Your wish is my IO (). If I break, you can: 1. Restart: M-x haskell-process-restart 2. Configure logging: C-h v haskell-process-log (useful for debugging) 3. General config: M-x customize-mode 4. Hide these tips: C-h v haskell-process-show-debug-tips Changed directory: /home/trifon/fmisync/Courses/2021_22/FP_2021_22/sandbox/lectures/haskell/ λ> :t foldr foldr :: (t1 -> t2 -> t2) -> t2 -> [t1] -> t2 λ> :t foldr foldr :: (a -> b -> b) -> b -> [a] -> b λ> foldr (+) 0 [1..10] 55 λ> foldr (:) [] [1..10] [1,2,3,4,5,6,7,8,9,10] λ> map (+1) [1..10] [2,3,4,5,6,7,8,9,10,11] λ> map (+1) [1..10] [2,3,4,5,6,7,8,9,10,11] λ> filter (>0) [-5..5] [1,2,3,4,5] λ> filter (>0) [-5..5] [1,2,3,4,5] λ> foldl (+) 0 [1..10] 55 λ> length [1..10] 10 λ> length [1..10] 10 λ> [1..5] ++ [6..8] [1,2,3,4,5,6,7,8] λ> [1..5] ++ [6..8] [1,2,3,4,5,6,7,8] λ> length ([1..100000] ++ [1..100000]) 200000 λ> length ([1..1000000] ++ [1..1000000]) 2000000 λ> reverse [1..100000] [100000,99999,99998,99997,99996,99995Interrupted. λ> length (reverse [1..100000]) Interrupted. λ> length (reverse [1..10000]) Interrupted. λ> length (reverse [1..1000]) 1000 λ> length (reverse [1..5000]) 5000 λ> length (reverse [1..5000]) 5000 λ> length (reverse [1..100000]) 100000 λ> length (reverse [1..100000]) 100000 λ> elem 3 [1..10] True λ> elem 13 [1..10] False λ> elem 3 [1..10] True λ> elem 13 [1..10] False λ> foldr1 (+) [1..10] 55 λ> foldl1 (+) [1..10] 55 λ> last [1..10] 10 λ> last [1..10] 10 λ> last [1..10] 1 λ> last [1..10] 10 λ> foldr (+) 0 [1..10] 55 λ> scanr (+) 0 [1..10] [55,54,52,49,45,40,34,27,19,10,0] λ> foldl (+) 0 [1..10] 55 λ> scanl (+) 0 [1..10] [0,1,3,6,10,15,21,28,36,45,55] λ> scanr (+) 0 [1..10] [55,54,52,49,45,40,34,27,19,10,0] λ> scanr (+) 0 [1..10] [55,54,52,49,45,40,34,27,19,10,0] λ> scanr (+) 0 [1..10] [55,54,52,49,45,40,34,27,19,10,0] λ> scanl (+) 0 [1..10] [0,1,3,6,10,15,21,28,36,45,55] λ> zip [1..5] [20..30] [(1,20),(2,21),(3,22),(4,23),(5,24)] λ> zip [1..5] [20..30] [(1,20),(2,21),(3,22),(4,23),(5,24)] λ> zip "Hello" [0..4] [('H',0),('e',1),('l',2),('l',3),('o',4)] λ> "Hello" !! 3 'l' λ> "Hello" !! 4 'o' λ> "Hello" !! 10 *** Exception: /home/trifon/fmisync/Courses/2021_22/FP_2021_22/sandbox/lectures/haskell/Lists.hs:12:1-14: Non-exhaustive patterns in function head λ> unzip (zip "Hello" "world") ("Hello","world") λ> zip "Hello" "world" [('H','w'),('e','o'),('l','r'),('l','l'),('o','d')] λ> unzip (zip "Hello" "world") ("Hello","world") λ> unzip (zip "Hello" "world") ("Hello","world") λ> zipWith (+) [1..5] [2..6] [3,5,7,9,11] λ> zipWith (+) [1..5] [2..6] [3,5,7,9,11] λ> zipWith (+) [1..5] [2..6] [3,5,7,9,11] λ> unzip (zip "Hello" "world") ("Hello","world") λ> unzip (zip "Hello" "world") ("Hello","world") λ> takeWhile (>0) [1,3,5,-1,2,6] [1,3,5] λ> takeWhile (>0) [1..10] [1,2,3,4,5,6,7,8,9,10] λ> takeWhile (>0) [1..10] [1,2,3,4,5,6,7,8,9,10] λ> takeWhile (>0) [1,3,5,-1,2,6] [1,3,5] λ> takeWhile (>0) [1,3,5,-1,2,6] [1,3,5] λ> dropWhile (<0) [1,3,5,-1,2,6] [1,3,5,-1,2,6] λ> dropWhile (>0) [1,3,5,-1,2,6] [-1,2,6] λ> dropWhile (>0) [1..10] [] λ> dropWhile (>0) [-1..10] [-1,0,1,2,3,4,5,6,7,8,9,10] λ> zip [1..10] [1..10] [(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10)] λ> any (>0) [-1..3] True λ> all (>0) [-1..3] False λ> zip [1..5] (tail [1..5]) [(1,2),(2,3),(3,4),(4,5)] λ> sorted [1..5] True λ> sorted [1,2,6,5,3] False λ>