get

operator fun <Root, Value> Root.get(keyPath: KeyPath<Root, Value>): Value

Reads keyPath from this root.

The operator modifier also makes root[keyPath] available. The named form is useful when mirroring Swift's explicit keyPath: call-site label: root.get(keyPath = MyTypePaths.property).


operator fun <Root, Value> Root.get(caseKeyPath: CaseKeyPath<Root, Value>): Value?

Extracts caseKeyPath's focused value from this root.

The operator modifier also makes root[caseKeyPath] available. This is intentionally lossy for a nullable focus; use match when Matched(null) must remain distinguishable from a different case.