I'm trying to write a function that checks whether or not a given list is a palindrome. However, I can't figure out how to apply to functions to a given input. My Code looks like this:
isPalindrome :: [a] -> Bool
isPalindrome x
| head x == last x = True
| otherwise = isPalindrome tail (init x)
This doesn't work and I cant figure out why.