diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-03-17 11:05:29 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-03-17 11:05:29 +0800 |
commit | a9ee47b61558efe09aee23f5671aabd0c3747e8a (patch) | |
tree | 52426053545a54514d39300e2117bdda14a9b1ef /h6.hs | |
parent | 11a5fd38018498a7b7feb0e392ac36003b0440ac (diff) | |
download | h99-a9ee47b61558efe09aee23f5671aabd0c3747e8a.tar.gz h99-a9ee47b61558efe09aee23f5671aabd0c3747e8a.tar.bz2 h99-a9ee47b61558efe09aee23f5671aabd0c3747e8a.zip |
p -> h
Diffstat (limited to 'h6.hs')
-rw-r--r-- | h6.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 |