Skip to content

Instantly share code, notes, and snippets.

@xinuc
Created November 1, 2010 08:17
Show Gist options
  • Save xinuc/657813 to your computer and use it in GitHub Desktop.
Save xinuc/657813 to your computer and use it in GitHub Desktop.
palindrom in haskell
palindrom [] = True -- empty string
palindrom [_] = True -- a character
palindrom xs = (x == y) && (palindrom middle)
where x = head xs
y = last xs
middle = init (tail xs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment