1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

🔥 the helper function.

This commit is contained in:
Rob Rix 2017-09-10 17:46:25 +01:00
parent 49fd598b92
commit 80994e27dc

View File

@ -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