Created
October 2, 2018 13:36
-
-
Save makslevental/818305e913168c4374fe6dbcd0e39b75 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
module Lib | |
( isPalindrome | |
, preprocess | |
) where | |
preprocess :: String -> String | |
preprocess text = filter (not . ( ` elem ` ['!','.'])) text | |
isPalindrome :: String -> Bool | |
isPalindrome text = cleanText == reverse cleanText | |
where cleanText = preprocess text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment