From 6a0302acbf7ec8fd22848b69890c7fafb31297bc Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 24 Mar 2016 11:34:11 -0400 Subject: [PATCH] Replace rangeLists with a use of fromThese. --- src/Alignment.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Alignment.hs b/src/Alignment.hs index f8bb6ff5a..27b349a17 100644 --- a/src/Alignment.hs +++ b/src/Alignment.hs @@ -131,9 +131,8 @@ alignDiff sources diff = iter alignSyntax (alignPatch sources <$> diff) where lineRanges = runBothWith ((Join .) . These) (actualLineRanges <$> (characterRange <$> infos) <*> sources) groupChildrenByLine :: Join These [Range] -> [AlignedDiff leaf] -> [Join These (Range, [SplitDiff leaf Info])] -groupChildrenByLine ranges children = go rangeLists children - where rangeLists = these (flip (,) []) ((,) []) (,) (runJoin ranges) - go ranges children | (l:ls, r:rs) <- ranges +groupChildrenByLine ranges children = go (fromThese [] [] $ runJoin ranges) children + where go ranges children | (l:ls, r:rs) <- ranges , (child:rest) <- children = go ranges rest | otherwise = uncurry (alignWith (fmap (flip (,) []) . Join)) ranges