diff --git a/src/Interpreter.hs b/src/Interpreter.hs index 3e3d301de..3d237c7f2 100644 --- a/src/Interpreter.hs +++ b/src/Interpreter.hs @@ -55,8 +55,8 @@ run :: (Eq a, Eq annotation) => Comparable a annotation -> Algorithm a annotatio run _ (Pure diff) = Just diff run comparable (Free (Recursive (annotation1 :< a) (annotation2 :< b) f)) = run comparable . f $ recur a b where - recur (Indexed a') (Indexed b') | length a' == length b' = annotate . Indexed $ Prelude.zipWith (interpret comparable) a' b' - recur (Fixed a') (Fixed b') | length a' == length b' = annotate . Fixed $ Prelude.zipWith (interpret comparable) a' b' + recur (Indexed a') (Indexed b') | length a' == length b' = annotate . Indexed $ zipWith (interpret comparable) a' b' + recur (Fixed a') (Fixed b') | length a' == length b' = annotate . Fixed $ zipWith (interpret comparable) a' b' recur (Keyed a') (Keyed b') | Map.keys a' == bKeys = annotate . Keyed . Map.fromList . fmap repack $ bKeys where bKeys = Map.keys b' diff --git a/src/Term.hs b/src/Term.hs index 9519f22f5..87c5e527a 100644 --- a/src/Term.hs +++ b/src/Term.hs @@ -16,8 +16,8 @@ zipTerms (annotation1 :< a) (annotation2 :< b) = annotate $ zipUnwrap a b where annotate = fmap (Both (annotation1, annotation2) :<) zipUnwrap (Leaf _) (Leaf b') = Just $ Leaf b' - zipUnwrap (Indexed a') (Indexed b') = Just . Indexed . catMaybes $ Prelude.zipWith zipTerms a' b' - zipUnwrap (Fixed a') (Fixed b') = Just . Fixed . catMaybes $ Prelude.zipWith zipTerms a' b' + zipUnwrap (Indexed a') (Indexed b') = Just . Indexed . catMaybes $ zipWith zipTerms a' b' + zipUnwrap (Fixed a') (Fixed b') = Just . Fixed . catMaybes $ zipWith zipTerms a' b' zipUnwrap (Keyed a') (Keyed b') | keys a' == keys b' = Just . Keyed . fromList . catMaybes $ zipUnwrapMaps a' b' <$> keys a' zipUnwrap _ _ = Nothing zipUnwrapMaps a' b' key = (,) key <$> zipTerms (a' ! key) (b' ! key) diff --git a/test/AlignmentSpec.hs b/test/AlignmentSpec.hs index fc1988515..642c699da 100644 --- a/test/AlignmentSpec.hs +++ b/test/AlignmentSpec.hs @@ -69,7 +69,7 @@ spec = parallel $ do \ a b -> adjoinRows alignRows (pure (Closed [a])) [ b ] `shouldBe` [ pure (Closed [a]), b :: Row Char ] -- it "aligns closed lines" $ - -- foldr (adjoinRows alignRows) [] (Prelude.zipWith both (pureBy (/= '\n') <$> "[ bar ]\nquux") (pureBy (/= '\n') <$> "[\nbar\n]\nquux")) `shouldBe` + -- foldr (adjoinRows alignRows) [] (zipWith both (pureBy (/= '\n') <$> "[ bar ]\nquux") (pureBy (/= '\n') <$> "[\nbar\n]\nquux")) `shouldBe` -- [ both (Closed "[ bar ]\n") (Closed "[\n") -- , both (Closed "") (Closed "bar\n") -- , both (Closed "") (Closed "]\n") diff --git a/test/CorpusSpec.hs b/test/CorpusSpec.hs index 99c8cf4b0..70bd559df 100644 --- a/test/CorpusSpec.hs +++ b/test/CorpusSpec.hs @@ -66,7 +66,7 @@ examples directory = do where globFor :: String -> IO [FilePath] globFor p = globDir1 (compile p) directory - toDict list = Map.fromList ((normalizeName <$> list) `Prelude.zip` list) + toDict list = Map.fromList ((normalizeName <$> list) `zip` list) -- | Given a test name like "foo.A.js", return "foo.js". normalizeName :: FilePath -> FilePath