From 08071a1b90060c93acf07f79535ee92d3bf24168 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 26 Jul 2023 15:28:57 -0400 Subject: [PATCH] improve match result display simplifier Sponsored-by: Dartmouth College's DANDI project --- Utility/Matcher.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Utility/Matcher.hs b/Utility/Matcher.hs index 23dec0c22f..e252eae538 100644 --- a/Utility/Matcher.hs +++ b/Utility/Matcher.hs @@ -242,6 +242,12 @@ describeMatchResult descop l prefix = Just $ -- (foo and bar) and baz => foo and bar and baz simplify _ (MatchedOpen:o1@(MatchedOperation {}):MatchedAnd:o2@(MatchedOperation {}):MatchedClose:MatchedAnd:rest) = o1:MatchedAnd:o2:MatchedAnd:simplify False rest + -- or (foo) => or foo + simplify _ (MatchedOr:MatchedOpen:o@(MatchedOperation {}):MatchedClose:rest) = + MatchedOr:o:simplify False rest + -- and (foo) => and foo + simplify _ (MatchedAnd:MatchedOpen:o@(MatchedOperation {}):MatchedClose:rest) = + MatchedAnd:o:simplify False rest -- (not foo) => not foo simplify _ (MatchedOpen:MatchedNot:o@(MatchedOperation {}):MatchedClose:rest) = MatchedNot:o:simplify False rest -- 2.30.2