mirror of
https://github.com/github/semantic.git
synced 2024-11-25 11:04:00 +03:00
merge
returns a Term
.
This commit is contained in:
parent
415822c1af
commit
8b5c0c87f8
@ -118,8 +118,8 @@ public enum Free<A, B>: CustomDebugStringConvertible, SyntaxConvertible {
|
||||
extension Free where B: PatchType, B.Element == Cofree<A, ()> {
|
||||
public typealias Term = B.Element
|
||||
|
||||
public func merge(transform: B -> Term) -> Free {
|
||||
return flatMap(transform >>> Free.init)
|
||||
public func merge(transform: B -> Term) -> Term {
|
||||
return map(transform).iterate { Cofree((), $0) }
|
||||
}
|
||||
|
||||
private func discardNullTerms(syntax: Syntax<Term?, A>) -> Term? {
|
||||
|
Loading…
Reference in New Issue
Block a user