From 80994e27dc0a021f6dfb9e370d06cd2a0dfd15f1 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sun, 10 Sep 2017 17:46:25 +0100 Subject: [PATCH] :fire: the helper function. --- src/Diff.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Diff.hs b/src/Diff.hs index 0aedf6b7e..f58c7f6bd 100644 --- a/src/Diff.hs +++ b/src/Diff.hs @@ -67,10 +67,9 @@ evalDiffR algebra = flip go mempty Var var -> algebra (Var var) env evalDiffRM :: (Functor syntax, Reader (Env (Diff syntax ann, Eff fs a)) :< fs) => (DiffF syntax ann (Diff syntax ann, Eff fs a) -> Eff fs a) -> Diff syntax ann -> Eff fs a -evalDiffRM algebra = go - where go = para $ \ diff -> case diff of - Copy bindings _ _ -> local (flip (foldr (uncurry envExtend)) bindings) (algebra diff) - _ -> algebra diff +evalDiffRM algebra = para $ \ diff -> case diff of + Copy bindings _ _ -> local (flip (foldr (uncurry envExtend)) bindings) (algebra diff) + _ -> algebra diff diffSum :: (Foldable syntax, Functor syntax) => (forall a. Patch a -> Int) -> Diff syntax ann -> Int