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

We don’t need Cofree terms to construct patches.

This commit is contained in:
Rob Rix 2015-10-15 11:18:06 -04:00
parent cd7e67c30d
commit 6ee73cca06

View File

@ -121,8 +121,10 @@ extension Free where B: PatchConvertible, B.Element == Cofree<A, ()> {
public var inverse: Free {
return map { B(patch: $0.patch.inverse) }
}
}
extension Free where B: PatchConvertible {
public static func Replace(before: B.Element, _ after: B.Element) -> Free {
return .Pure(B(patch: .Replace(before, after)))
}