summaryrefslogtreecommitdiff
path: root/p6.hs
diff options
context:
space:
mode:
Diffstat (limited to 'p6.hs')
-rw-r--r--p6.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/p6.hs b/p6.hs
new file mode 100644
index 0000000..dc643eb
--- /dev/null
+++ b/p6.hs
@@ -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