From e5d345dca798070a9055e3b0853a8ecff1186c37 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sun, 10 Sep 2017 15:15:14 +0100 Subject: [PATCH] Simplify the selection of patches. --- src/Renderer/TOC.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Renderer/TOC.hs b/src/Renderer/TOC.hs index a5d6590e4..50eb9db72 100644 --- a/src/Renderer/TOC.hs +++ b/src/Renderer/TOC.hs @@ -157,7 +157,7 @@ tableOfContentsBy selector = fromMaybe [] . evalDiff diffAlgebra (Just a, Just []) -> Just [Changed a] (_ , entries) -> entries Var v -> join (envLookup v env) - Patch patch -> foldMap (\ t -> maybe (fold t) (Just . pure . patchEntry patch) (selector t)) patch + Patch patch -> foldMap (\ t -> fold t <> (pure . patchEntry patch <$> selector t)) patch patchEntry = these (const Deleted) (const Inserted) (const (const Replaced)) . unPatch