diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Utils.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Utils.hs b/lib/Utils.hs index 1eb42fc..4c9a581 100644 --- a/lib/Utils.hs +++ b/lib/Utils.hs | |||
@@ -4,6 +4,7 @@ module Utils ( binaryToInt | |||
4 | , right | 4 | , right |
5 | , bet | 5 | , bet |
6 | , (&+) | 6 | , (&+) |
7 | , howMany | ||
7 | ) where | 8 | ) where |
8 | 9 | ||
9 | import Data.Char (digitToInt) | 10 | import Data.Char (digitToInt) |
@@ -30,3 +31,6 @@ bet k (l, u) = k >= l && k <= u | |||
30 | -- combine filter predicates | 31 | -- combine filter predicates |
31 | (&+) :: (a -> Bool) -> (a -> Bool) -> (a -> Bool) | 32 | (&+) :: (a -> Bool) -> (a -> Bool) -> (a -> Bool) |
32 | (&+) = liftM2 (&&) | 33 | (&+) = liftM2 (&&) |
34 | |||
35 | howMany :: (a -> Bool) -> [a] -> Int | ||
36 | howMany predicate = length . filter ((== True) . predicate) | ||