Created
May 13, 2015 11:45
-
-
Save shigemk2/109182a18568213d2b29 to your computer and use it in GitHub Desktop.
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
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 |
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
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