From 4e74eeebbaa441cda3a6846c47d82516878f8f05 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Wed, 25 Dec 2024 14:25:09 +0530 Subject: Add searching indication text for search mode + a lot of refactoring --- src/Chelleport/Utils.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Chelleport/Utils.hs') diff --git a/src/Chelleport/Utils.hs b/src/Chelleport/Utils.hs index 9423e5d..3f0dd73 100644 --- a/src/Chelleport/Utils.hs +++ b/src/Chelleport/Utils.hs @@ -43,3 +43,9 @@ itemAt (_ : xs) i = itemAt xs (i - 1) clamp :: (Integral a) => (a, a) -> a -> a clamp (low, high) n = max low (min high n) + +(<&&>) :: [a -> Bool] -> a -> Bool +(<&&>) preds ev = all (\p -> p ev) preds + +(<||>) :: (a -> Bool) -> (a -> Bool) -> a -> Bool +(<||>) p1 p2 x = p1 x || p2 x -- cgit v1.3.1