diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-12-25 14:25:09 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-12-25 14:25:09 +0530 |
| commit | 4e74eeebbaa441cda3a6846c47d82516878f8f05 (patch) | |
| tree | 7a67bfd8cfbef2092931fd4d12a8ce69b3b3d2d4 /src/Chelleport/Utils.hs | |
| parent | 82d612b7c37b432bc4abd8e158d6fe076d391ddc (diff) | |
| download | chelleport-4e74eeebbaa441cda3a6846c47d82516878f8f05.tar.gz chelleport-4e74eeebbaa441cda3a6846c47d82516878f8f05.zip | |
Add searching indication text for search mode + a lot of refactoring
Diffstat (limited to 'src/Chelleport/Utils.hs')
| -rw-r--r-- | src/Chelleport/Utils.hs | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
