Skip to content

Instantly share code, notes, and snippets.

@MiyamonY
Created February 27, 2015 09:53
Show Gist options
  • Save MiyamonY/af15733b673a38eae21a to your computer and use it in GitHub Desktop.
Save MiyamonY/af15733b673a38eae21a to your computer and use it in GitHub Desktop.
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