Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created May 13, 2015 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/109182a18568213d2b29 to your computer and use it in GitHub Desktop.
Save shigemk2/109182a18568213d2b29 to your computer and use it in GitHub Desktop.
abcba
i am non ma i
so am i
i am a loooooooooong line!!!
yeah i’m long so what hahahaha!!!!!!
short line
loooooooooooooooooooooooooooong
short
main = interact respondPalindromes
respondPalindromes :: String -> String
respondPalindromes =
unlines .
map (\xs -> if isPal xs then "palindrome" else "not a palindrome") .
lines
isPal :: String -> Bool
isPal xs = xs == reverse xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment