text_delta v1.0.1 TextDelta.Delta.Iterator

Iterator iterates over two deltas at the same time, ensuring next elements in the resulting stream are of equal length.

Summary

Types

A tuple representing the new head operations and tail deltas of the two deltas being iterated over

A delta’s next scanned full or partial operation, and its resulting tail delta

Two deltas to iterate

A type which is not to be sliced when iterating. Can be :insert, :delete or nil

Functions

Generates next cycle by iterating over given deltas

Types

cycle()
cycle() :: {delta_split, delta_split}

A tuple representing the new head operations and tail deltas of the two deltas being iterated over.

delta_split()
delta_split() :: {TextDelta.Operation.t | nil, TextDelta.Delta.t}

A delta’s next scanned full or partial operation, and its resulting tail delta.

deltas()

Two deltas to iterate.

skip_type()
skip_type() :: :insert | :delete | nil

A type which is not to be sliced when iterating. Can be :insert, :delete or nil

Functions

next(deltas, skip_type \\ nil)
next(deltas, skip_type) :: cycle

Generates next cycle by iterating over given deltas.