1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 10:27:45 +03:00

Don’t bind the individual info functions.

This commit is contained in:
Rob Rix 2017-05-05 16:00:52 -04:00
parent e667657d94
commit 2491dde0f9

View File

@ -94,10 +94,10 @@ diffTOC blobs diff = removeDupes (diffToTOCSummaries (source <$> blobs) diff) >>
diffToTOCSummaries :: (StringConv leaf Text, HasDefaultFields fields) => Both Source -> SyntaxDiff leaf fields -> [TOCSummary DiffInfo]
diffToTOCSummaries sources = para $ \diff ->
let diff' = free (Prologue.fst <$> diff)
in case first (toTOCSummaries . mapPatch beforeInfo afterInfo) diff of
in case first (toTOCSummaries . runBothWith mapPatch toInfo) diff of
Free _ -> mapToInSummarizable sources diff' (toList diff >>= snd)
Pure summaries -> summaries
where (beforeInfo, afterInfo) = runJoin $ termToDiffInfo <$> sources
where toInfo = termToDiffInfo <$> sources
-- Mark which leaves are summarizable.
toTOCSummaries :: Patch DiffInfo -> [TOCSummary DiffInfo]