From e8c165fb155b7cc837bf66ce5e1e87e8cf2a98b6 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 17 Jun 2016 11:29:27 -0400 Subject: [PATCH] Use mappend instead of ++. --- src/Alignment.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Alignment.hs b/src/Alignment.hs index 37cd63982..3533c715a 100644 --- a/src/Alignment.hs +++ b/src/Alignment.hs @@ -86,7 +86,7 @@ alignBranch getRange children ranges = case intersectingChildren of _ -> case intersectionsWithHeadRanges <$> listToMaybe symmetricalChildren of -- At least one child intersects on both sides, so align symmetrically. Just (True, True) -> let (line, remaining) = lineAndRemaining intersectingChildren (Just headRanges) in - line $ alignBranch getRange (remaining ++ nonIntersectingChildren) (drop 1 <$> ranges) + line $ alignBranch getRange (remaining <> nonIntersectingChildren) (drop 1 <$> ranges) -- A symmetrical child intersects on the right, so align asymmetrically on the left. Just (False, True) -> alignAsymmetrically leftRange first -- A symmetrical child intersects on the left, so align asymmetrically on the right. @@ -101,7 +101,7 @@ alignBranch getRange children ranges = case intersectingChildren of Just headRanges = sequenceL (listToMaybe <$> Join (runBothWith These ranges)) (leftRange, rightRange) = splitThese headRanges alignAsymmetrically range advanceBy = let (line, remaining) = lineAndRemaining asymmetricalChildren range in - line $ alignBranch getRange (remaining ++ symmetricalChildren ++ nonIntersectingChildren) (modifyJoin (advanceBy (drop 1)) ranges) + line $ alignBranch getRange (remaining <> symmetricalChildren <> nonIntersectingChildren) (modifyJoin (advanceBy (drop 1)) ranges) lineAndRemaining _ Nothing = (identity, []) lineAndRemaining children (Just ranges) = let (intersections, remaining) = alignChildren getRange children ranges in ((:) $ (,) <$> ranges `applyToBoth` (sortBy (compare `on` getRange) <$> intersections), remaining)