1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Add an Insert constructor to Free when used as a diff.

This commit is contained in:
Rob Rix 2015-10-15 11:10:35 -04:00
parent 8366dc752a
commit ce633f555a

View File

@ -126,6 +126,10 @@ extension Free where B: PatchConvertible, B.Element == Cofree<A, ()> {
public static func Replace(before: B.Element, _ after: B.Element) -> Free {
return .Pure(B(patch: .Replace(before, after)))
}
public static func Insert(after: B.Element) -> Free {
return .Pure(B(patch: .Insert(after)))
}
}