poole@CPSC-M-POOLE01 haskell % ghci GHCi, version 9.4.8: https://www.haskell.org/ghc/ :? for help ghci> :type 1.7 + fromIntegral (div 100 7) 1.7 + fromIntegral (div 100 7) :: Fractional a => a ghci> 1.7 + fromIntegral (div 100 7) 15.7 ghci> 1.7 + fromIntegral (div 100 7)::Float 15.7 ghci> 5:[7] [5,7] ghci> :load Lists [1 of 1] Compiling Lists ( Lists.hs, interpreted ) Ok, one module loaded. ghci> myelem 3 [1,2,3,4,5] True ghci> myelem 3 [1,2,4,5] False ghci> :load Lists [1 of 1] Compiling Lists ( Lists.hs, interpreted ) Ok, one module loaded. ghci> app [2,3,4] [7,8,9] [2,3,4,7,8,9] ghci> app [2,3 4] [True, True] :10:6: error: • No instance for (Num Bool) arising from the literal ‘2’ • In the expression: 2 In the first argument of ‘app’, namely ‘[2, 3 4]’ In the expression: app [2, 3 4] [True, True] :10:8: error: • No instance for (Num (Integer -> Bool)) arising from the literal ‘3’ (maybe you haven't applied a function to enough arguments?) • In the expression: 3 4 In the first argument of ‘app’, namely ‘[2, 3 4]’ In the expression: app [2, 3 4] [True, True] ghci> 2 : app [3,4] [7,8,9] [2,3,4,7,8,9] ghci> (h:t) = [3,4] ghci> h 3 ghci> t [4] ghci> [3,4] ++++ [7,89] [3,4,7,89] ghci> [3,4] ++ [7,89] [3,4,7,89] ghci> numeq 3 [2,3,4,5,4,3,2,3,5] 3 ghci> numc (==3) [2,3,4,5,4,3,2,3,5] 3 ghci> (==3) 2 False ghci> (==3) 3 True ghci> numc (<2) [2,3,4,5,4,3,2,3,5] 0 ghci> numc (<=2) [2,3,4,5,4,3,2,3,5] 2 ghci> numc (>2) [2,3,4,5,4,3,2,3,5] 7 ghci> :type [1,2,3] [1,2,3] :: Num a => [a] ghci> :type "abc" "abc" :: String ghci> numc (='a') "abbaacada" :26:7: error: parse error on input ‘=’ ghci> numc (=='a') "abbaacada" 5 ghci> ghci> [1,2,3] ++++ [’a’,’b’] :29:15: error: lexical error at character 'a' ghci> [1,2,3] ++++ ['a','b'] :30:2: error: • No instance for (Num Char) arising from the literal ‘1’ • In the expression: 1 In the first argument of ‘(++++)’, namely ‘[1, 2, 3]’ In the expression: [1, 2, 3] ++++ ['a', 'b'] ghci> :l Lists [1 of 1] Compiling Lists ( Lists.hs, interpreted ) Ok, one module loaded. ghci> myfilter (>2) [1,2,3,43,2,4,1,5] [3,43,4,5] ghci> :type length length :: Foldable t => t a -> Int ghci> length [2,3,4] 3 ghci> :type div div :: Integral a => a -> a -> a ghci> [1,2] :: [Int] [1,2] ghci> [1,2] :: [Num] :37:11: error: • Expecting one more argument to ‘Num’ Expected a type, but ‘Num’ has kind ‘* -> Constraint’ • In an expression type signature: [Num] In the expression: [1, 2] :: [Num] In an equation for ‘it’: it = [1, 2] :: [Num] ghci> :type [1,2] [1,2] :: Num a => [a] ghci> Leaving GHCi. poole@CPSC-M-POOLE01 haskell %