diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-01-31 19:35:16 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-01-31 19:35:16 +0800 |
commit | d7a259acf6ff7cdda231b489b3707d8948b6507c (patch) | |
tree | a8b0c776806cc40afd3fe5e53ea57c13c7452f0a | |
parent | ab8fe6397a6cbe1fefe08c21c6d6d7f6eff910bc (diff) | |
download | h99-d7a259acf6ff7cdda231b489b3707d8948b6507c.tar.gz h99-d7a259acf6ff7cdda231b489b3707d8948b6507c.tar.bz2 h99-d7a259acf6ff7cdda231b489b3707d8948b6507c.zip |
p6
-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 |