*Main> :t add' 1 add' 1 :: Int -> Int *Main> add' 1 :4:1: error: • No instance for (Show (Int -> Int)) arising from a use of ‘print’ (maybe you haven't applied a function to enough arguments?) • In a stmt of an interactive GHCi command: print it *Main> add' 1 2 3 *Main> :t (\ x y -> x + y) 1 (\ x y -> x + y) 1 :: Num a => a -> a *Main> (\ x y -> x + y) 1 2 3 *Main> :t (+) (+) :: Num a => a -> a -> a *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> myLength "abcdefg" 7 *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> myLength' "ab" 2 *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> append [1,2,3] [4,5,6] [1,2,3,4,5,6] *Main> append [] [4,5,6] [4,5,6] *Main> append [1,2,3] [] [1,2,3] *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> append' [1,2,3] [4,5,6] [1,2,3,4,5,6] *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> zip' [1,2,3] "abc" [(1,'a'),(2,'b'),(3,'c')] *Main> zip' [1,2,3] "ab" [(1,'a'),(2,'b')*** Exception: lec2.hs:(65,1)-(66,40): Non-exhaustive patterns in function zip' *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> zip' [1,2,3] "ab" [(1,'a'),(2,'b')] *Main> zip' [1,2,3] "abc" [(1,'a'),(2,'b'),(3,'c')] *Main> zip'' [1,2,3] "ab" :27:1: error: • Variable not in scope: zip'' :: [Integer] -> [Char] -> t • Perhaps you meant ‘zip'’ (line 65) *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> zip'' [1,2,3] "ab" [(1,'a'),(2,'b')] *Main> zip'' [1,2,3] "abc" [(1,'a'),(2,'b'),(3,'c')] *Main> 30 `mod` 4 2 *Main> (71+72+73+28) `mod` 4 0 *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> myReverse [1,2,3,4,5] [5,4,3,2,1] *Main> myReverse' [1,2,3,4,5] [] :5:1: error: • Couldn't match expected type ‘[a0] -> t’ with actual type ‘[Integer]’ • The function ‘myReverse'’ is applied to two arguments, but its type ‘[Integer] -> [Integer]’ has only one In the expression: myReverse' [1, 2, 3, 4, ....] [] In an equation for ‘it’: it = myReverse' [1, 2, 3, ....] [] • Relevant bindings include it :: t (bound at :5:1) *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) lec2.hs:109:1: error: Duplicate type signatures for ‘myReverse'’ at lec2.hs:81:1-10 lec2.hs:109:1-10 | 109 | myReverse' :: [a] -> [a] | ^^^^^^^^^^ lec2.hs:110:1: error: Multiple declarations of ‘myReverse'’ Declared at: lec2.hs:82:1 lec2.hs:110:1 | 110 | myReverse' = undefined | ^^^^^^^^^^ Failed, no modules loaded. Prelude> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> myReverse' [1,2,3,4,5] [] [5,4,3,2,1] *Main> :r [1 of 1] Compiling Main ( lec2.hs, interpreted ) Ok, one module loaded. *Main> [1 .. 10 ] [1,2,3,4,5,6,7,8,9,10] *Main> myMap (\ x -> x + 2) [1 .. 10] [3,4,5,6,7,8,9,10,11,12] *Main> myMap (\ x -> "x" ++ ",") "abcdefg" ["x,","x,","x,","x,","x,","x,","x,"] *Main> myMap (\ x -> x : ",") "abcdefg" ["a,","b,","c,","d,","e,","f,","g,"] *Main> :t concat concat :: Foldable t => t [a] -> [a] *Main> concat (myMap (\ x -> x : ",") "abcdefg") "a,b,c,d,e,f,g," *Main>