1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Free.merge’s argument does not escape.

This commit is contained in:
Rob Rix 2015-10-28 12:04:56 -04:00
parent d7eb23d291
commit 8ca7cf7599

View File

@ -131,11 +131,11 @@ extension Free {
extension Free where Value: PatchType, Value.Element == Cofree<Leaf, ()> {
public typealias Term = Value.Element
public func merge(transform: Value -> Term) -> Term {
public func merge(@noescape transform: Value -> Term) -> Term {
return map(transform).cata { Cofree((), $0) }
}
public func merge(transform: Value -> Term?) -> Term? {
public func merge(@noescape transform: Value -> Term?) -> Term? {
return map(transform).cata(Free.discardNullTerms)
}