Advertisement
Guest User

Untitled

a guest
Jul 8th, 2022
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. Prelude> myReverse x = drop 9 x ++ " " ++ take 4 $ drop 5 x ++" "++ take 5 x
  2.  
  3. <interactive>:7:15: error:
  4. • Couldn't match expected type ‘[Char] -> t’
  5. with actual type ‘[Char]’
  6. • The first argument of ($) takes one argument,
  7. but its type ‘[Char]’ has none
  8. In the expression:
  9. drop 9 x ++ " " ++ take 4 $ drop 5 x ++ " " ++ take 5 x
  10. In an equation for ‘myReverse’:
  11. myReverse x
  12. = drop 9 x ++ " " ++ take 4 $ drop 5 x ++ " " ++ take 5 x
  13. • Relevant bindings include
  14. myReverse :: [Char] -> t (bound at <interactive>:7:1)
  15.  
  16. <interactive>:7:34: error:
  17. • Couldn't match expected type ‘[Char]’
  18. with actual type ‘[a0] -> [a0]’
  19. • Probable cause: ‘take’ is applied to too few arguments
  20. In the second argument of ‘(++)’, namely ‘take 4’
  21. In the second argument of ‘(++)’, namely ‘" " ++ take 4’
  22. In the expression: drop 9 x ++ " " ++ take 4
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement