The next big Haskell project is about to start! 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 λ> 1.5 == 1.5 True λ> sin sin :: Floating a => a -> a λ> show 1234 "1234" λ> show [1, 5] "[1,5]" λ> read "[1,5]" *** Exception: Prelude.read: no parse λ> :t read read :: Read a => String -> a λ> :t show show :: Show a => a -> String λ> (read "[1,5]")::[Int] [1,5] λ> (read "[1,5]")::[Double] [1.0,5.0] λ> (read "[1,5]")::[Char] "*** Exception: Prelude.read: no parse λ> :t 2 2 :: Num p => p λ> :t (div 2 5) (div 2 5) :: Integral a => a λ> :t (div 2 500000000000000000000) (div 2 500000000000000000000) :: Integral a => a λ> :t (div 2 500000000000000000000000000000) (div 2 500000000000000000000000000000) :: Integral a => a λ> [ (x,y) | x <- [1..3], y <- [4..6]] [(1,4),(1,5),(1,6),(2,4),(2,5),(2,6),(3,4),(3,5),(3,6)] λ> map (\x -> x) [1..3] [1,2,3] λ> map (\x -> (map (\y -> (x,y)) [4..6])) [1..3] [[(1,4),(1,5),(1,6)],[(2,4),(2,5),(2,6)],[(3,4),(3,5),(3,6)]] λ> concat (map (\x -> (map (\y -> (x,y)) [4..6])) [1..3]) [(1,4),(1,5),(1,6),(2,4),(2,5),(2,6),(3,4),(3,5),(3,6)] λ> foldr (\x r -> x == 0 || r) False [-5..5] True λ> foldr (\x r -> x == 0 || r) False [5..50] False λ> foldr (\x r -> (||) (x == 0) r) False [5..50] False λ> foldr (\x -> (|| x == 0)) False [5..50] False λ> foldr (\x -> (|| x == 0)) False [-5..5] True λ> foldr (\x -> (x == 0 ||)) False [-5..5] True λ> maximum [] *** Exception: Prelude.maximum: empty list λ> foldr1 (+) [] *** Exception: Prelude.foldr1: empty list λ> foldr1 (\_ x -> x) [1..10] 10 λ> foldl1 (\_ x -> x) [1..10] 10 λ> scanr (+) 0 [1..10] [55,54,52,49,45,40,34,27,19,10,0] λ> foldr (+) 0 [1..10] 55 λ> foldl (+) 0 [1..10] 55 λ> scanl (+) 0 [1..10] [0,10,9,8,7,6,5,4,3,2,1] λ> foldr (:) [] [1..10] [1,2,3,4,5,6,7,8,9,10] λ> scanr (:) [] [1..10] [[1,2,3,4,5,6,7,8,9,10],[2,3,4,5,6,7,8,9,10],[3,4,5,6,7,8,9,10],[4,5,6,7,8,9,10],[5,6,7,8,9,10],[6,7,8,9,10],[7,8,9,10],[8,9,10],[9,10],[10],[]] λ> Data.List.tails [1..10] [[1,2,3,4,5,6,7,8,9,10],[2,3,4,5,6,7,8,9,10],[3,4,5,6,7,8,9,10],[4,5,6,7,8,9,10],[5,6,7,8,9,10],[6,7,8,9,10],[7,8,9,10],[8,9,10],[9,10],[10],[]] λ> foldl (flip (:)) [] [1..10] [10,9,8,7,6,5,4,3,2,1] λ> scanl (+) 0 [1..10] [0,1,3,6,10,15,21,28,36,45,55] λ> scanl (flip (:)) [] [1..10] [[],[1],[2,1],[3,2,1],[4,3,2,1],[5,4,3,2,1],[6,5,4,3,2,1],[7,6,5,4,3,2,1],[8,7,6,5,4,3,2,1],[9,8,7,6,5,4,3,2,1],[10,9,8,7,6,5,4,3,2,1]] λ> scanl (\r x -> r ++ [x]) [] [1..10] [[],[1],[1,2],[1,2,3],[1,2,3,4],[1,2,3,4,5],[1,2,3,4,5,6],[1,2,3,4,5,6,7],[1,2,3,4,5,6,7,8],[1,2,3,4,5,6,7,8,9],[1,2,3,4,5,6,7,8,9,10]] λ> Data.List.inits [1..10] [[],[1],[1,2],[1,2,3],[1,2,3,4],[1,2,3,4,5],[1,2,3,4,5,6],[1,2,3,4,5,6,7],[1,2,3,4,5,6,7,8],[1,2,3,4,5,6,7,8,9],[1,2,3,4,5,6,7,8,9,10]] λ> scanr (:) [] [1..10] [[1,2,3,4,5,6,7,8,9,10],[2,3,4,5,6,7,8,9,10],[3,4,5,6,7,8,9,10],[4,5,6,7,8,9,10],[5,6,7,8,9,10],[6,7,8,9,10],[7,8,9,10],[8,9,10],[9,10],[10],[]] λ> scanr (+) 0 [1..10] [55,54,52,49,45,40,34,27,19,10,0] λ> zip [1..5] [2..6] [(1,2),(2,3),(3,4),(4,5),(5,6)] λ> zip [1..5] [2..6] [(1,2),(2,3),(3,4),(4,5),(5,6)] λ> unzip (zip [1..5] [2..6]) ([1,2,3,4,5],[2,3,4,5,6]) λ> zipWith (*) [1..5] [2..6] [2,6,12,20,30] λ> zipWith (*) [1..5] [2..6] [2,6,12,20,30] λ> zip [1..5] [2..6] [(1,2),(2,3),(3,4),(4,5),(5,6)] λ> takeWhile (<5) [1..10] [1,2,3,4] λ> Prelude.takeWhile (const True) [1..10] [1,2,3,4,5,6,7,8,9,10] λ> takeWhile (<5) [1..10] [] λ> takeWhile (<5) [1..10] [1,2,3,4] λ> dropWhile (<5) [1..10] [5,6,7,8,9,10] λ> Prelude.dropWhile (const True) [1..10] [] λ> Prelude.dropWhile (const False) [1..10] [1,2,3,4,5,6,7,8,9,10] λ> takeWhile odd [1..5] [1] λ> dropWhile odd [1..5] [2,3,4,5] λ> dropWhile (<5) [1..10] [5,6,7,8,9,10] λ>