1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 18:06:14 +03:00

Add a convenience to construct branch diffs.

This commit is contained in:
Rob Rix 2016-03-21 18:54:34 -04:00
parent 361bfc0e81
commit 62ac37c981

View File

@ -66,6 +66,9 @@ spec = parallel $ do
patchWithBoth (Delete ()) = Delete . fst
patchWithBoth (Replace () ()) = runBothWith Replace
branch :: annotation -> [Free (Annotated String annotation) patch] -> Free (Annotated String annotation) patch
branch annotation = Free . Annotated annotation . Indexed
leaf :: annotation -> String -> Free (Annotated String annotation) patch
leaf info = Free . Annotated info . Leaf