1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +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,8 +67,7 @@ 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
evalDiffRM algebra = para $ \ diff -> case diff of
Copy bindings _ _ -> local (flip (foldr (uncurry envExtend)) bindings) (algebra diff)
_ -> algebra diff