Skip to content

Instantly share code, notes, and snippets.

@kaveet
Created November 17, 2016 16:23
Show Gist options
  • Save kaveet/acf4d9cd6bbfdd8351fe31b6372a3a0e to your computer and use it in GitHub Desktop.
Save kaveet/acf4d9cd6bbfdd8351fe31b6372a3a0e to your computer and use it in GitHub Desktop.
Haskell Palindrome Checker
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