mirror of
https://github.com/github/semantic.git
synced 2024-11-28 01:47:01 +03:00
Interpretation.
This commit is contained in:
parent
7c09fd1503
commit
16e4bf891d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user