Created
November 1, 2010 08:17
-
-
Save xinuc/657813 to your computer and use it in GitHub Desktop.
palindrom in haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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