The underlying type of the tree.
An updated zipper pointing at a new focus.
import {Zipper, from, of} from 'effect-tree'
import {pipe} from 'effect'
// ┬1
// ├─2
// ├─3
// └─4
const tree = from(1, of(2), of(3), of(4))
const start = pipe(tree, Zipper.fromTree, Zipper.head)
const hop1 = Zipper.next(start)
expect(Zipper.getValue(hop1)).toBe(3)
const hop2 = Zipper.next(hop1)
expect(Zipper.getValue(hop2)).toBe(4)
// Out-of-bounds exception when nowhere left to go.
expect(() => Zipper.next(hop2)).toThrow(/getOrThrow/)
Navigate from a node to its next sibling or throw an exception if the focused node is the last node in its forest. Unsafe version of tryNext.