blob: dc643ebbae534569ce8e2944e55a54e4112421e5 (
plain)
1
2
3
4
5
6
7
8
9
10
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
|