From 563973e21075907e91c8a99b4341d4fdf2ada6de Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 4 Dec 2015 10:48:04 -0500 Subject: [PATCH] Use starts/ends. --- src/Split.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Split.hs b/src/Split.hs index f105189de..2e886e22b 100644 --- a/src/Split.hs +++ b/src/Split.hs @@ -46,13 +46,13 @@ annotatedToRows (Annotated (Info left _ leftCategories, Info right _ rightCatego annotatedToRows (Annotated (Info left _ leftCategories, Info right _ rightCategories) (Indexed i)) before after = (bimap (Ul $ classify leftCategories) (Ul $ classify rightCategories) <$> rows, (left, right)) where - rows = appendRemainder $ foldl sumRows ([], (start left, start right)) i + rows = appendRemainder $ foldl sumRows ([], starts left right) i appendRemainder (rows, (previousLeft, previousRight)) = adjoinRows rows contextRows where contextRows = uncurry rowFromMaybeRows <$> zipMaybe leftElements rightElements leftElements = Text <$> lines (substring (Range previousLeft $ end left) before) rightElements = Text <$> lines (substring (Range previousRight $ end right) after) - sumRows (rows, (previousLeft, previousRight)) child = (rows `adjoinRows` contextRows `adjoinRows` childRows, (end leftChildRange, end rightChildRange)) + sumRows (rows, (previousLeft, previousRight)) child = (rows `adjoinRows` contextRows `adjoinRows` childRows, ends leftChildRange rightChildRange) where (childRows, (leftChildRange, rightChildRange)) = diffToRows child before after contextRows = uncurry rowFromMaybeRows <$> zipMaybe leftElements rightElements