Created
March 2, 2022 11:16
-
-
Save nattybear/2061b56b48a82ce56f917ece140b4ef4 to your computer and use it in GitHub Desktop.
palindromes.hs
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
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 | |
main = interact respondPalindromes |
Author
nattybear
commented
Mar 2, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment