From 0823ca7f698bdb426e87f782c68e6bb5a0506b30 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 21 Dec 2015 11:01:44 -0500 Subject: [PATCH] Move starts/ends into the where clause. --- src/Split.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Split.hs b/src/Split.hs index 77b6a4233..a8e5efb6d 100644 --- a/src/Split.hs +++ b/src/Split.hs @@ -198,6 +198,8 @@ annotatedToRows (Annotated (Info left leftCategories, Info right rightCategories sources = (before, after) childRows = appendRemainder . foldl sumRows ([], starts ranges) appendRemainder (rows, previousIndices) = reverse . foldl (adjoin2By openElement) [] $ rows ++ contextRows (ends ranges) previousIndices sources + starts (left, right) = (start left, start right) + ends (left, right) = (end left, end right) sumRows (rows, previousIndices) child = (allRows, ends childRanges) where separatorRows = contextRows (starts childRanges) previousIndices sources @@ -220,12 +222,6 @@ textElements :: Range -> String -> [HTML] textElements range source = elementAndBreak Text =<< actualLines s where s = substring range source -starts :: (Range , Range) -> (Int, Int) -starts (left, right) = (start left, start right) - -ends :: (Range, Range) -> (Int, Int) -ends (left, right) = (end left, end right) - rowFromMaybeRows :: Maybe HTML -> Maybe HTML -> Row HTML rowFromMaybeRows a b = Row (maybe EmptyLine (Line False . (:[])) a) (maybe EmptyLine (Line False . (:[])) b)