From 8fbdd8e6c3132ca7cda38a7620704094b7a59eba Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 23 Oct 2017 09:39:00 -0400 Subject: [PATCH] :fire: diffSum. --- src/Data/Diff.hs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Data/Diff.hs b/src/Data/Diff.hs index d4bfca093..297179717 100644 --- a/src/Data/Diff.hs +++ b/src/Data/Diff.hs @@ -61,12 +61,6 @@ merging :: Functor syntax => Term syntax ann -> Diff syntax ann ann merging = cata (\ (In ann syntax) -> mergeF (In (ann, ann) syntax)) -diffSum :: (Foldable syntax, Functor syntax) => (forall a b. Patch a b -> Int) -> Diff syntax ann1 ann2 -> Int -diffSum patchCost = cata $ \ diff -> case diff of - Patch patch -> patchCost patch + sum (sum <$> patch) - Merge merge -> sum merge - - diffPatch :: Diff syntax ann1 ann2 -> Maybe (Patch (TermF syntax ann1 (Diff syntax ann1 ann2)) (TermF syntax ann2 (Diff syntax ann1 ann2))) diffPatch diff = case unDiff diff of Patch patch -> Just patch