isPalindrome::(Eq a) => [a] -> Bool
isPalindrome [] = True
isPalindrome [x] = True
isPalindrome (x1:xs:x2:[])
| x1 == x2 = isPalindrome xs
|otherwise = False
[1 of 1] Compiling Main (myHas.hs, interpreted)
myHas.hs:37:27:
Couldn't match expected type `[a]' against inferred type `a1'
`a1' is a rigid type variable bound by
the type signature for `isPalindrome' at myHas.hs:33:18
In the first argument of `isPalindrome', namely `xs'
In the expression: isPalindrome xs
In the definition of `isPalindrome':
isPalindrome (x1 : xs : x2 : [])
| x1 == x2 = isPalindrome xs
| otherwise = False
Soy un programador principiante de Haskell y no tengo ni idea de por qué estoy recibiendo este error, ¿alguna ayuda por favor?programador haskell principiante
¿Se ha solucionado este problema? – MGwynne