From bb40b363ba975cc2cfbe7a92513da34317f9bdd3 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 4 Aug 2016 11:40:35 -0400 Subject: [PATCH] Diff Array nodes byIndex. --- src/Interpreter.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Interpreter.hs b/src/Interpreter.hs index 6ca2f27b1..340430b1a 100644 --- a/src/Interpreter.hs +++ b/src/Interpreter.hs @@ -42,6 +42,7 @@ diffComparableTerms construct comparable cost = recur algorithmWithTerms :: (TermF leaf (Both a) diff -> diff) -> Term leaf a -> Term leaf a -> Algorithm (Term leaf a) diff diff algorithmWithTerms construct t1 t2 = case (unwrap t1, unwrap t2) of (Indexed a, Indexed b) -> byIndex Indexed a b + (Array a, Array b) -> byIndex Array a b _ -> recursively t1 t2 where annotate = pure . construct . (both (extract t1) (extract t2) :<) byIndex constructor a b = Algorithm.byIndex a b >>= annotate . constructor