From 1f783ea59ae07b146362aa90afcd069263091718 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 2 Mar 2016 18:15:27 -0500 Subject: [PATCH] Use runBothWith to simplify packing and unpacking. --- src/Alignment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Alignment.hs b/src/Alignment.hs index ec46215a9..71319d3e8 100644 --- a/src/Alignment.hs +++ b/src/Alignment.hs @@ -52,7 +52,7 @@ splitPatchByLines patch previous sources = case patch of Replace leftTerm rightTerm -> (zipWithDefaults makeRow (pure mempty) $ fmap (fmap (Pure . SplitReplace)) <$> lines, ranges) where (lines, ranges) = unpackLinesAndRanges $ splitTermByLines <$> both leftTerm rightTerm <*> sources unpackLinesAndRanges :: Both ([Line (Term leaf Info)], Range) -> (Both [Line (Term leaf Info)], Both Range) - unpackLinesAndRanges = uncurry (uncurry bimap) . first (bimap both both) . runBoth + unpackLinesAndRanges = runBothWith (uncurry bimap . bimap both both) -- | Takes a term and a source and returns a list of lines and their range within source. splitTermByLines :: Term leaf Info -> Source Char -> ([Line (Term leaf Info)], Range)