aboutsummaryrefslogtreecommitdiff
path: root/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Utils.hs')
-rw-r--r--Utils.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Utils.hs b/Utils.hs
index 65bb651..60f8ff5 100644
--- a/Utils.hs
+++ b/Utils.hs
@@ -1,7 +1,13 @@
module Utils where
+import Data.List
+import Data.Maybe
+
uniq :: Eq a => [a] -> [a]
uniq (a:b:cs) | a == b = uniq (b:cs)
| otherwise = a : uniq (b:cs)
uniq l = l
+
+contains :: Eq a => [a] -> a -> Bool
+contains l v = isJust $ find (== v) l