aboutsummaryrefslogtreecommitdiffstats
path: root/utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'utils.hs')
-rw-r--r--utils.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils.hs b/utils.hs
index ee89ea1..9fcc553 100644
--- a/utils.hs
+++ b/utils.hs
@@ -37,3 +37,6 @@ splitToPair f lst =
let x' = takeWhile (not . f) lst
y' = dropWhile (not . f) lst $> drop 1
in (x', y')
+
+count :: (a -> Bool) -> [a] -> Int
+count pred xs = xs $> filter pred .> length \ No newline at end of file