diff --git a/src/Interpreter.hs b/src/Interpreter.hs index c83afb571..df661aebe 100644 --- a/src/Interpreter.hs +++ b/src/Interpreter.hs @@ -11,6 +11,10 @@ recur a b = run algorithm where algorithm = Free $ Recursive a b Pure - run :: Algorithm a (Diff a) -> Maybe (Diff a) run (Pure diff) = Just diff + +interpret :: Term a Info -> Term a Info -> Diff a +interpret a b = maybeReplace $ recur a b where + maybeReplace (Just a) = a + maybeReplace Nothing = Just a Just b