Created
February 26, 2009 06:30
-
-
Save wfarr/70697 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 Main | |
| where | |
| import Char | |
| isPal :: (Monad m) => [Char] -> m Bool | |
| isPal str = | |
| let _str = (map Char.toLower str) in | |
| if length _str == 1 then | |
| return True | |
| else | |
| if head _str == last _str then | |
| isPal ((init . tail) _str) | |
| else | |
| return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment