text_delta v1.1.0 TextDelta.Iterator

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

Summary

Types

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

Individual set of operations

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

Two sets of operations 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 sets of operations

Types

cycle()
cycle() :: {set_split, set_split}

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

set()

Individual set of operations.

set_split()
set_split() :: {TextDelta.Operation.t | nil, set}

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

sets()
sets() :: {set, set}

Two sets of operations 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(sets, skip_type \\ nil)
next(sets, skip_type) :: cycle

Generates next cycle by iterating over given sets of operations.