1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Interpretation.

This commit is contained in:
Rob Rix 2015-11-17 17:13:48 -08:00
parent 7c09fd1503
commit 16e4bf891d

View File

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