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

📝 the Algorithm DSL.

This commit is contained in:
Rob Rix 2016-08-04 12:08:18 -04:00
parent b4683ffc4f
commit e1bb2297af

View File

@ -19,11 +19,14 @@ data AlgorithmF
-- | A lazily-produced AST for diffing.
type Algorithm term diff = F (AlgorithmF term diff)
-- | Constructs a 'Recursive' diff of two terms.
recursively :: term -> term -> Algorithm term diff diff
recursively a b = wrap (Recursive a b pure)
-- | Constructs a 'ByIndex' diff of two lists of terms.
byIndex :: [term] -> [term] -> Algorithm term diff [diff]
byIndex a b = wrap (ByIndex a b pure)
-- | Constructs a 'BySimilarity' diff of two lists of terms.
bySimilarity :: [term] -> [term] -> Algorithm term diff [diff]
bySimilarity a b = wrap (BySimilarity a b pure)