Skip to content

Instantly share code, notes, and snippets.

@makslevental
Created October 2, 2018 13:36
Show Gist options
  • Save makslevental/818305e913168c4374fe6dbcd0e39b75 to your computer and use it in GitHub Desktop.
Save makslevental/818305e913168c4374fe6dbcd0e39b75 to your computer and use it in GitHub Desktop.
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