/// Computes the SES (shortest edit script), i.e. the shortest sequence of diffs (`Free>`) for two arrays of `Term`s which would suffice to transform `a` into `b`. /// /// This is computed w.r.t. an `equals` function, which computes the equality of leaf nodes within terms, and a `recur` function, which produces diffs representing matched-up terms. public func SES(a: C, _ b: C, cost: Free> -> Int, recur: (C.Generator.Element, C.Generator.Element) -> Free>?) -> [Free>] { typealias Diff = Free> if a.isEmpty { return b.map { .Insert($0) } } if b.isEmpty { return a.map { .Delete($0) } } // A matrix whose values are streams representing paths through the edit graph, carrying both the diff & the cost of the remainder of the path. var matrix: Matrix, C.Index>! matrix = Matrix(across: a.startIndex..