diff --git a/src/Alignment.hs b/src/Alignment.hs index 8c03041ca..e074aa2dd 100644 --- a/src/Alignment.hs +++ b/src/Alignment.hs @@ -23,7 +23,7 @@ import Data.Bifunctor.These import Data.Coalescent import Data.Copointed import Data.Foldable -import Data.Functor.Both as Both hiding (unzip) +import Data.Functor.Both as Both import Data.Functor.Identity import Data.Maybe import Data.Monoid diff --git a/src/Data/Functor/Both.hs b/src/Data/Functor/Both.hs index 6ce5c6473..4b8abed36 100644 --- a/src/Data/Functor/Both.hs +++ b/src/Data/Functor/Both.hs @@ -42,10 +42,6 @@ fst = Prelude.fst . runBoth snd :: Both a -> a snd = Prelude.snd . runBoth -unzip :: [Both a] -> Both [a] -unzip = foldr pair (pure []) - where pair head tail = (:) <$> head <*> tail - instance Monoid a => Monoid (Join (,) a) where mempty = pure mempty mappend a b = mappend <$> a <*> b diff --git a/src/Renderer/Patch.hs b/src/Renderer/Patch.hs index 0cb643c17..18e9d14fa 100644 --- a/src/Renderer/Patch.hs +++ b/src/Renderer/Patch.hs @@ -65,7 +65,7 @@ showHunk blobs hunk = maybeOffsetHeader ++ -- | Given the before and after sources, render a change to a string. showChange :: Both (Source Char) -> Change (SplitDiff a Info) -> String showChange sources change = showLines (snd sources) ' ' (snd <$> context change) ++ deleted ++ inserted - where (deleted, inserted) = runBoth $ pure showLines <*> sources <*> both '-' '+' <*> Both.unzip (contents change) + where (deleted, inserted) = runBoth $ pure showLines <*> sources <*> both '-' '+' <*> Join (unzip (runJoin <$> contents change)) -- | Given a source, render a set of lines to a string with a prefix. showLines :: Source Char -> Char -> [Line (SplitDiff leaf Info)] -> String