You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where if you diff two lists from the same original lists and merge the resulting diffs, you get what you would if you had originally diff3'd all three together at the same time.
I see that toHunk in the source appears to have the right type signature -- I'm not exactly sure what it does, but does it give the behavior I am thinking of?
The text was updated successfully, but these errors were encountered:
I don't think toHunk is quite what you want - note that it's called here only in the degenerate cases where one of the lists is empty. Can I ask what your use case is?
Actually I just realized that what I'm thinking about is exactly step from the implementation of diff3 :)
My particular use case is for working with "patches" as standalone data types, where a [Diff A] is a patch that can be applied to an [A]. (if it was generated using getDiff). The point is to be able to manipulate patches on their own and then re-apply when ready. Merging two patches is such an operation, and a [Diff A] -> [Diff A] -> [Diff A] would do the trick.
It looks like that is essentially what step is doing though, so I might be looking at that for a reference. Thanks for the pointer!
What do you feel about a PR possibly exporting step as a standalone function with its own name, with some descriptive documentation talking about when it is applicable?
Hi! Thanks for the great library.
Was wondering if there was any meaningful way to "merge" two
[Diff a]
's into a[Hunk a]
, such that:Where if you diff two lists from the same original lists and merge the resulting diffs, you get what you would if you had originally
diff3
'd all three together at the same time.I see that
toHunk
in the source appears to have the right type signature -- I'm not exactly sure what it does, but does it give the behavior I am thinking of?The text was updated successfully, but these errors were encountered: