Insert

@Serializable
data class Insert<V>(val id: FugueId, val value: V, val parent: FugueId, val side: FugueSide, val rightOrigin: FugueId?) : FugueOp<V>

Insert value with identity id.

The Fugue tree placement is specified by parent and side:

  • parent is the tree node this element is a child of (not the sequence left-neighbour — the tree parent is computed from the sequence context at insert time).

  • side = FugueSide.Left: left child of parent (inserted after a descendant of parent).

  • side = FugueSide.Right: right child of parent (inserted into parent's open right slot). rightOrigin records the next element in the traversal at insert time, used to sort right siblings.

Constructors

Link copied to clipboard
constructor(id: FugueId, value: V, parent: FugueId, side: FugueSide, rightOrigin: FugueId?)

Properties

Link copied to clipboard
open override val id: FugueId

The FugueId of the element this operation creates or tombstones.

Link copied to clipboard
Link copied to clipboard

Non-null only when side == FugueSide.Right.

Link copied to clipboard
Link copied to clipboard
val value: V