Created
November 17, 2016 16:23
-
-
Save kaveet/acf4d9cd6bbfdd8351fe31b6372a3a0e to your computer and use it in GitHub Desktop.
Haskell Palindrome Checker
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
module Palindrome where | |
palindrome :: Eq a => [a] -> Bool | |
palindrome [] = True | |
palindrome [_] = True | |
palindrome xs = (head xs) == (last xs) && (palindrome $ init $ tail xs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment