1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Revert "Add a function to merge This/That into These at the head of a list."

This reverts commit 3af1f3f080a5ce725b79b6120cb639e8a3a35e80.
This commit is contained in:
Rob Rix 2016-05-27 13:07:46 -04:00
parent 2e77455195
commit 87ce5de22f

View File

@ -184,16 +184,6 @@ alignChildren getRange (first:rest) headRanges
where (firstRemaining, restRemaining) = alignChildren getRange rest headRanges
toTerms line = modifyJoin (fromThese [] []) (pure . (<$ first) <$> line)
mergeOntoThese :: Maybe (Join These a) -> [Join These a] -> [Join These a]
mergeOntoThese newHead list = case newHead of
Just t -> case list of
(first:rest) -> case (t, first) of
(Join (This a), Join (That b)) -> Join (These a b) : rest
(Join (That b), Join (This a)) -> Join (These a b) : rest
_ -> t : first : rest
[] -> [t]
Nothing -> list
unionThese :: (Alternative f, Foldable f, Monoid (f a)) => f (Join These a) -> Join These (f a)
unionThese as = fromMaybe (Join (These empty empty)) . getUnion . fold $ Union . Just . fmap pure <$> as