Created
February 27, 2015 09:53
-
-
Save MiyamonY/af15733b673a38eae21a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 :: IO () | |
main = interact respondPalidromes | |
respondPalidromes :: String -> String | |
respondPalidromes = unlines . map (\ xs -> if isPal xs then "palidrome" else "not a palidrome") . 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