From c36986723085fa10ba060b735a14423b50dbe1de Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 8 May 2017 17:16:48 -0400 Subject: [PATCH] Simplify toJSONSummaries. --- src/Renderer/TOC.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Renderer/TOC.hs b/src/Renderer/TOC.hs index 5074d843d..bf3a1b915 100644 --- a/src/Renderer/TOC.hs +++ b/src/Renderer/TOC.hs @@ -129,11 +129,9 @@ diffTOC blobs diff = removeDupes (diffToTOCSummaries (source <$> blobs) diff) >> isSummarizable _ = False toJSONSummaries :: TOCSummary DiffInfo -> [JSONSummary] -toJSONSummaries TOCSummary{..} = toJSONSummaries' (afterOrBefore summaryPatch) - where - toJSONSummaries' diffInfo = case diffInfo of - ErrorInfo{..} -> [ErrorSummary termName infoSpan] - LeafInfo{..} -> maybe [] (pure . JSONSummary) parentInfo +toJSONSummaries TOCSummary{..} = case afterOrBefore summaryPatch of + ErrorInfo{..} -> [ErrorSummary termName infoSpan] + LeafInfo{..} -> maybe [] (pure . JSONSummary) parentInfo toTermName :: HasDefaultFields fields => Source -> Term (Syntax Text) (Record fields) -> Text toTermName source = para $ \ (annotation :< syntax) -> case syntax of