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

Double down on annotations.

This commit is contained in:
Rob Rix 2015-10-22 16:02:03 -04:00
parent 49fb14f6a8
commit d6a9be0794
5 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ public enum Algorithm<Term: CofreeType, Result> {
public typealias Patch = Doubt.Patch<Term>
/// The type of `Diff`s which `Algorithm`s produce.
public typealias Diff = Free<Term.Leaf, Term.Annotation, Patch>
public typealias Diff = Free<Term.Leaf, (Term.Annotation, Term.Annotation), Patch>
/// The injection of a value of type `Result` into an `Operation`.
///

View File

@ -1,7 +1,7 @@
/// An interpreter of `Algorithm`s.
public struct Interpreter<Term: CofreeType> {
/// The type of diffs constructed by `Interpreter`s.
public typealias Diff = Free<Term.Leaf, Term.Annotation, Patch<Term>>
public typealias Diff = Free<Term.Leaf, (Term.Annotation, Term.Annotation), Patch<Term>>
/// Constructs an `Interpreter` parameterized by the `equal` and `comparable` tests on `Term`s, and the `cost` function for `Diff`s.
///

View File

@ -4,7 +4,7 @@ final class DiffTests: XCTestCase {
}
typealias Term = RangedTerm.Term
typealias Diff = Free<String, Term.Annotation, Patch<Term>>
typealias Diff = Free<String, (Term.Annotation, Term.Annotation), Patch<Term>>
let interpreter = Interpreter<Term>(equal: ==, comparable: const(true), cost: Diff.sum(const(1)))

View File

@ -21,7 +21,7 @@ final class InterpreterTests: XCTestCase {
private typealias Term = Cofree<String, Int>
private typealias Diff = Free<String, Int, Patch<Term>>
private typealias Diff = Free<String, (Int, Int), Patch<Term>>
private let a = Term(0, [ Term(1, .Leaf("a")), Term(2, .Leaf("b")), Term(3, .Leaf("c")) ])
private let b = Term(0, [ Term(1, .Leaf("c")), Term(2, .Leaf("b")), Term(3, .Leaf("a")) ])

View File

@ -1,5 +1,5 @@
struct RangedDiff {
typealias Diff = Free<String, RangedTerm.Term.Annotation, Patch<RangedTerm.Term>>
typealias Diff = Free<String, (RangedTerm.Term.Annotation, RangedTerm.Term.Annotation), Patch<RangedTerm.Term>>
let a: RangedTerm
let b: RangedTerm