diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-10-17 09:29:31 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-10-17 09:29:31 +0200 |
commit | 0d7cb474e6eb9a8bb5b6c9b1adf09b3b29760ff1 (patch) | |
tree | be5608ddfac7cbe3fa00f9afa3b663aae19833df /app/Issue/Filter.hs | |
parent | 236316221dc1fe4152028d7720b68a437bb3ea52 (diff) |
allow empty-valued (bool) tags
Diffstat (limited to 'app/Issue/Filter.hs')
-rw-r--r-- | app/Issue/Filter.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/Issue/Filter.hs b/app/Issue/Filter.hs index c330407..fb6d205 100644 --- a/app/Issue/Filter.hs +++ b/app/Issue/Filter.hs @@ -7,6 +7,7 @@ where import Control.Applicative (liftA2) import Control.Arrow (second) +import Data.Maybe (fromMaybe) import Data.Text (Text) import Data.Text qualified as T import Issue (Issue (..)) @@ -63,4 +64,4 @@ simpleFilterPredicate :: SimpleFilter -> (Issue -> Bool) simpleFilterPredicate (ByTag k v) i = any ((&&) <$> matchKey <*> matchValue) i.tags where matchKey (Tag k' _) = k' == k - matchValue (Tag _ v') = maybe True ((==) v') v + matchValue (Tag _ v') = fromMaybe True ((==) <$> v' <*> v) |