Skip to content

Instantly share code, notes, and snippets.

@andrewhavck
Created May 27, 2010 05:43
Show Gist options
  • Save andrewhavck/415507 to your computer and use it in GitHub Desktop.
Save andrewhavck/415507 to your computer and use it in GitHub Desktop.
-- file: ch03/Palindrome.hs
palindrome :: [a] -> [a]
palindrome [] = []
palindrome xs = xs ++ myReverse xs
where myReverse (x:xs) = myReverse xs ++ [x]
myReverse [] = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment