Diff

object Diff
Companion
class
class Object
trait Matchable
class Any

Type members

Classlikes

sealed trait Bimap

Allows for mapping indices bidirectionally between the base and target sequences.

Allows for mapping indices bidirectionally between the base and target sequences.

sealed trait Chunk[T]

Alternative representation of the diffing output that holds all data elements, changed and unchanged ones.

Alternative representation of the diffing output that holds all data elements, changed and unchanged ones.

Companion
object
object Chunk
Companion
class
trait Eq[T]

Very simple equality type class, which allows for customizing the comparison logic employed by the diff algorith. By default universal value equality is used.

Very simple equality type class, which allows for customizing the comparison logic employed by the diff algorith. By default universal value equality is used.

Companion
object
object Eq
Companion
class
sealed trait Op

An ADT for all "operations" the diff algorithm can derive. Operations don't contain any elements themselves, they only hold indices into the base and target sequences for maximum efficiency.

An ADT for all "operations" the diff algorithm can derive. Operations don't contain any elements themselves, they only hold indices into the base and target sequences for maximum efficiency.

If you need something that holds all data required to transform base into target, including the actual elements, check out Patch.

Companion
object
object Op
Companion
class
final case class Patch[T](baseSize: Int, targetSize: Int, steps: ArraySeq[Step[T]])

A Patch encapsulates all information required to transform the base sequence into the target sequence.

A Patch encapsulates all information required to transform the base sequence into the target sequence.

In addition to the data of which elements need to be deleted and/or moved it also contains the actual elements that are to be inserted.

Companion
object
object Patch
Companion
class
final class Slice[T](val underlying: IndexedSeq[T], _from: Int, _until: Int) extends Slice[T]

An IndexedSeqView.Slice that surfaces the underlying sequence as well as the index range.

An IndexedSeqView.Slice that surfaces the underlying sequence as well as the index range.

Companion
object
object Slice
Companion
class

Value members

Concrete methods

def apply[T](base: IndexedSeq[T], target: IndexedSeq[T])(`evidence$1`: Eq[T]): Diff[T]

Runs a relatively efficient, stacksafe, linear space implementation of the Myers diff algorithm and returns the result as a Diff instance, which serves as the tee-off point for further, downstream logic.

Runs a relatively efficient, stacksafe, linear space implementation of the Myers diff algorithm and returns the result as a Diff instance, which serves as the tee-off point for further, downstream logic.

The core algorithm is based on the work of Robert Elder.

See also
def longestCommonSubsequence[T](base: IndexedSeq[T], target: IndexedSeq[T])(`evidence$2`: Eq[T], `evidence$3`: ClassTag[T]): ArraySeq[T]

Returns a longest common subsequence of the base and target sequences. or None, if the two sequences have no elements in common. Stacksafe and reasonably efficient.

Returns a longest common subsequence of the base and target sequences. or None, if the two sequences have no elements in common. Stacksafe and reasonably efficient.

def minEditDistance[T](base: IndexedSeq[T], target: IndexedSeq[T])(eq: Eq[T]): Int

Returns the minimum number of edits required to transform base and target, whereby one "edit" corresponds to deleting or inserting one single element.

Returns the minimum number of edits required to transform base and target, whereby one "edit" corresponds to deleting or inserting one single element.

Equal to Diff(base, target).delInsOps.size but more efficient.