diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2021-12-14 08:45:15 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2021-12-15 09:59:09 +0200 |
| commit | ca42298c307a3009720d6bc93f294ae308168262 (patch) | |
| tree | 14a79e1132340b198cde39410e24ebbbfad46014 /utils.hs | |
| parent | 31ca38b2824a8d4e8257e14b1a783016ff37258e (diff) | |
Day 14
Diffstat (limited to 'utils.hs')
| -rw-r--r-- | utils.hs | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 |
