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

Patches have different costs.

This commit is contained in:
Rob Rix 2015-10-06 17:08:22 -04:00
parent 4fdbcf948f
commit d7db7415dc

View File

@ -11,7 +11,7 @@ public func SES<A>(a: [Fix<A>], _ b: [Fix<A>], equals: (A, A) -> Bool, recur: (F
if b.isEmpty { return a.map { Diff.Pure(Patch.Delete($0)) } }
func cost(diff: Diff) -> Int {
return diff.map(const(1)).iterate { syntax in
return diff.map { $0.cost }.iterate { syntax in
switch syntax {
case .Leaf:
return 0