aboutsummaryrefslogtreecommitdiff
path: root/Utils.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-08-20 14:47:15 +0200
committertomsmeding <tom.smeding@gmail.com>2017-08-20 14:47:15 +0200
commitc36fd5a174ab74465b8562c5fb4fa69a25dfca79 (patch)
treecebd29dfb75e4713934a995ad13b957769194e7d /Utils.hs
parentf8d264f2b18fccdc3b96d8fb66656128a25137f2 (diff)
Fourth
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