1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Define deleteRemaining in terms of insertMapped.

This commit is contained in:
Rob Rix 2017-10-23 14:45:11 -04:00
parent 6bd44acdda
commit 1dcc904639

View File

@ -95,8 +95,7 @@ deleteRemaining :: Traversable t
=> [MappedDiff syntax ann1 ann2]
-> t (UnmappedTerm syntax ann1)
-> [MappedDiff syntax ann1 ann2]
deleteRemaining diffs unmappedAs =
foldl' (flip insertDiff) diffs (This . (termIndex &&& term) <$> unmappedAs)
deleteRemaining diffs remaining = insertMapped (This . (termIndex &&& term) <$> remaining) diffs
-- | Inserts an index and diff pair into a list of indices and diffs.
insertDiff :: MappedDiff syntax ann1 ann2