1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 17:59:10 +03:00

Implement a function copying terms into diffs.

This commit is contained in:
Rob Rix 2015-10-06 16:59:11 -04:00
parent a628177722
commit a1a832012e

View File

@ -38,6 +38,9 @@ public func SES<A>(a: [Fix<A>], _ b: [Fix<A>], equals: (A, A) -> Bool, recur: (F
let diagonal = matrix[i + 1, j + 1]
let diff = recur(a[i], b[j])
func copy(term: Term) -> Diff {
return Diff.Roll(term.out.map(copy))
}
if let right = right, down = down, diagonal = diagonal {
let costs = (right: costOfStream(right), down: costOfStream(down), diagonal: costOfStream(diagonal))