1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 15:35:14 +03:00

Simplify the base case.

This commit is contained in:
Rob Rix 2016-03-08 21:57:29 -05:00
parent 761e5abe93
commit 57b2d1f645

View File

@ -30,6 +30,5 @@ coalesceLinesBy _ line nextLine = [line, nextLine]
-- | Merge open lines and prepend closed lines (as determined by a pair of functions) onto a list of rows.
adjoinRowsBy :: Both (MaybeOpen a) -> Row a -> [Row a] -> [Row a]
adjoinRowsBy _ row [] = [ row ]
adjoinRowsBy f row (nextRow : rows) = zipWithDefaults makeRow (pure EmptyLine) (coalesceLinesBy <$> f <*> unRow row <*> unRow nextRow) ++ rows
adjoinRowsBy _ row rows = row : rows