diff options
-rw-r--r-- | p6.hs | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -0,0 +1,11 @@ +import Control.Monad +import Control.Applicative + +isPalindrome :: Eq a => [a] -> Bool +isPalindrome xs = xs == reverse xs + +isPalindrome' :: (Eq a) => [a] -> Bool +isPalindrome' = liftM2 (==) id reverse + +isPalindrome'' :: (Eq a) => [a] -> Bool +isPalindrome'' = (==) <*> reverse |