Open renovatorruler opened 3 years ago
main = text(stringFromBool(isPalindrome ls))
isPalindrome : List String -> Bool isPalindrome xs = xs == listReverse xs
listReverse : List String -> List String listReverse xs = case xs of [] -> [] x:: tail -> (listReverse tail) ++ [x] stringFromBool : Bool -> String stringFromBool value = if value then "True"
else "False"
Add code by encasing it like this btw
Create a function called
isPalindrome
which will take aList a
and return whether it is a palindrome or not (see example or ask me for clarification).