Package-level declarations

Types

Link copied to clipboard

Type-erased metadata common to all CaseKeyPaths.

Link copied to clipboard
interface AnyKeyPath : AnyPath

Type-erased metadata common to all property key paths.

Link copied to clipboard
interface AnyPath

Metadata shared by all generated paths, independent of their focusing capability.

Link copied to clipboard

Standard paths for a mutable Array. Indexed paths mutate the same array instance.

Link copied to clipboard

Standard paths for BooleanArray.

Link copied to clipboard

Standard paths for ByteArray.

Link copied to clipboard

A conditional, typed read through one case of a sealed hierarchy.

Link copied to clipboard

Base class for generated read-only CaseKeyPaths with structural identity.

Link copied to clipboard
sealed interface CaseMatch<out Value>

The exact outcome of attempting to match a CaseKeyPath against a root value.

Link copied to clipboard

Standard paths for CharArray.

Link copied to clipboard

Standard read-only paths for CharSequence.

Link copied to clipboard

Standard paths for DoubleArray.

Link copied to clipboard

Standard paths for FloatArray.

Link copied to clipboard

Standard paths for IntArray.

Link copied to clipboard

A total, typed read path.

Link copied to clipboard

Base class for generated total property key paths.

Link copied to clipboard
data class KPathsRuntimeWarning(val message: String, val pathId: PathId)

A non-fatal runtime diagnostic emitted by KPaths.

Link copied to clipboard
expect object KPathsRuntimeWarnings

Configures delivery of non-fatal KPaths runtime diagnostics.

actual object KPathsRuntimeWarnings

Configures delivery of non-fatal KPaths runtime diagnostics.

actual object KPathsRuntimeWarnings

Configures delivery of non-fatal KPaths runtime diagnostics.

Link copied to clipboard

Standard read-only paths for an immutable List.

Link copied to clipboard

Standard paths for LongArray.

Link copied to clipboard

Standard paths for an immutable Map. Setting a focused null removes its key.

Link copied to clipboard

Standard paths for a MutableList. Indexed paths mutate the same list instance.

Link copied to clipboard

Standard paths for a MutableMap. Setting a focused null removes its key in place.

Link copied to clipboard

Standard read-only paths for a Pair.

Link copied to clipboard

A type-erased-value CaseKeyPath with a known root.

Link copied to clipboard

A key path with a known root type and an erased, but always-present, focused value.

Link copied to clipboard
abstract class PathBase : AnyPath

Base class for generated paths.

Link copied to clipboard
class PathId(val rootType: TypeId, segments: List<PathSegment>)

The structural identity of a generated KeyPath or CaseKeyPath.

Link copied to clipboard
sealed interface PathSegment

A named step in a KeyPath or CaseKeyPath structural identity.

Link copied to clipboard

A writable key path whose replacement mutates the same root instance.

Link copied to clipboard

Base class for generated paths that mutate a property on the same root instance.

Link copied to clipboard

Standard paths for ShortArray.

Link copied to clipboard

Standard read-only paths for String.

Link copied to clipboard

Standard read-only paths for a Triple.

Link copied to clipboard
data class TypeArgument(val variance: TypeVariance, val type: TypeId?)

A type argument, including its use-site variance or a star projection.

Link copied to clipboard
class TypeId(val classifier: String, arguments: List<TypeArgument> = emptyList(), val nullable: Boolean = false)

A generated, structural description of a Kotlin type.

Link copied to clipboard

Kotlin use-site variance as part of a structural TypeId.

Link copied to clipboard

A typed property path that replaces a focus and returns the resulting root.

Link copied to clipboard

Base class for generated immutable-write key paths.

Properties

Link copied to clipboard

Intentionally collapses CaseMatch.NoMatch and CaseMatch.Matched with a null value.

Functions

Link copied to clipboard

Appends two CaseKeyPaths, retaining independent embedding through both cases.

Appends a total read path.

Composition rooted in a reference-writable path remains reference-writable: setting the final focus updates the same outer root instance.

Appends two writable paths, retaining immutable replacement capability.

Link copied to clipboard

Appends a path after force-unwrapping a nullable focus.

Appends a writable path after force-unwrapping a nullable reference-owned focus.

Appends a writable path after force-unwrapping a nullable focus.

Link copied to clipboard

Optionally appends a read path after a nullable focus.

Link copied to clipboard

Captures an Array's complete element type token from a reified Kotlin context.

Link copied to clipboard

Kotlin-friendly property-reference spelling of keyPath.

Link copied to clipboard
Link copied to clipboard
inline fun <Root : Any, Case : Root> caseKeyPath(): CaseKeyPath<Root, Case>

Creates an independently embeddable whole-case CaseKeyPath for a concrete subtype of a sealed root.

inline fun <Root : Enum<Root>> caseKeyPath(case: Root): CaseKeyPath<Root, Unit>

Creates an independently embeddable whole-case CaseKeyPath for one Enum entry, focused as Unit.

inline fun <Root : Any, Case : Root, Value> caseKeyPath(extract: KProperty1<Case, Value>, noinline embed: (Value) -> Case): CaseKeyPath<Root, Value>

Creates an independently embeddable CaseKeyPath for one case payload property.

inline fun <Root, Value> caseKeyPath(id: PathId, noinline match: (Root) -> CaseMatch<Value>, noinline embed: (Value) -> Root): CaseKeyPath<Root, Value>

Creates a read-only exact CaseKeyPath while capturing its complete focus type token.

inline fun <Root : Any, Case : Root, First, Second> caseKeyPath(extract1: KProperty1<Case, First>, extract2: KProperty1<Case, Second>, noinline embed: (First, Second) -> Case): CaseKeyPath<Root, Pair<First, Second>>

Creates an independently embeddable CaseKeyPath focused as an ordered Pair of two case properties.

fun <Root, Value> caseKeyPath(id: PathId, valueType: TypeId, match: (Root) -> CaseMatch<Value>, embed: (Value) -> Root): CaseKeyPath<Root, Value>

Creates a read-only exact CaseKeyPath.

inline fun <Root : Any, Case : Root, First, Second, Third> caseKeyPath(extract1: KProperty1<Case, First>, extract2: KProperty1<Case, Second>, extract3: KProperty1<Case, Third>, noinline embed: (First, Second, Third) -> Case): CaseKeyPath<Root, Triple<First, Second, Third>>

Creates an independently embeddable CaseKeyPath focused as an ordered Triple of three case properties.

Link copied to clipboard

Returns whether caseKeyPath matched this root, including when its matched focus is null.

Link copied to clipboard

Chains a second match operation only after this result matched.

Link copied to clipboard
inline fun <Value, Result> CaseMatch<Value>.fold(onNoMatch: () -> Result, onMatched: (Value) -> Result): Result

Folds the exact matching result into an arbitrary value.

Link copied to clipboard
operator fun <Root, Value> Root.get(caseKeyPath: CaseKeyPath<Root, Value>): Value?

Extracts caseKeyPath's focused value from this root.

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

Reads keyPath from this root.

Link copied to clipboard

Kotlin-style function spelling of valueOrNull.

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

Intentionally collapses an unmatched root and a matched null focus.

Link copied to clipboard

Captures Root's complete type token when called from a reified Kotlin context.

Returns the path that focuses the whole root.

Link copied to clipboard
inline fun <Root, Value> keyPath(property: KProperty1<Root, Value>): KeyPath<Root, Value>

Adapts a property reference while capturing its complete root and focus type tokens.

inline fun <Root, Value> keyPath(id: PathId, noinline get: (Root) -> Value): KeyPath<Root, Value>

Creates a total read path while capturing its complete focus type token at the call site.

@JvmName(name = "arrayKeyPathAt")
inline fun <Value> keyPath(noinline get: (Array<Value>, Int) -> Value, at: Int): KeyPath<Array<Value>, Value>

Creates a read path through an Array's indexed get operation at at.

@JvmName(name = "listKeyPathAt")
inline fun <Value> keyPath(noinline get: (List<Value>, Int) -> Value, at: Int): KeyPath<List<Value>, Value>

Creates a read path through a List's indexed get operation at at.

@JvmName(name = "mutableListKeyPathAt")
inline fun <Value> keyPath(noinline get: (MutableList<Value>, Int) -> Value, at: Int): KeyPath<MutableList<Value>, Value>

Creates a read path through a MutableList's indexed get operation at at.

inline fun <Root, Value> keyPath(name: String, noinline get: (Root) -> Value): KeyPath<Root, Value>

Creates a custom read path with a root-local stable name.

fun <Root, Value> keyPath(id: PathId, valueType: TypeId, get: (Root) -> Value): KeyPath<Root, Value>

Creates a total read path with an explicitly supplied structural identity and type token.

fun <Root, Value> keyPath(property: KProperty1<Root, Value>, id: PathId, valueType: TypeId): KeyPath<Root, Value>

Adapts a Kotlin property reference into a read-only path.

Link copied to clipboard

Captures a List's complete element type token from a reified Kotlin context.

Link copied to clipboard
inline fun <Value, NewValue> CaseMatch<Value>.map(transform: (Value) -> NewValue): CaseMatch<NewValue>

Transforms a matched value while retaining an unmatched result.

Link copied to clipboard
inline fun <Key, Value> MapPaths(): MapPaths<Key, Value>

Captures a Map's complete key and value type tokens from a reified Kotlin context.

Link copied to clipboard

Named spelling of exact case matching.

Link copied to clipboard

Views a non-null CaseKeyPath as a total, read-only KeyPath whose focus is nullable.

Link copied to clipboard
fun <Root, Value> Root.modifying(keyPath: WritableKeyPath<Root, Value>, update: (Value) -> Value): Root

Transforms keyPath's focus and returns the resulting root.

Link copied to clipboard

Captures a MutableList's complete element type token from a reified Kotlin context.

Link copied to clipboard

Captures a MutableMap's complete key and value type tokens from a reified Kotlin context.

Link copied to clipboard

Captures a Pair's complete component type tokens from a reified Kotlin context.

Link copied to clipboard

Adapts a mutable property reference while capturing its complete root and focus type tokens.

Creates an in-place path through a MutableMap's lookup operation at key.

inline fun <Root : Any, Value> referenceWritableKeyPath(id: PathId, noinline get: (Root) -> Value, noinline set: (Root, Value) -> Unit): ReferenceWritableKeyPath<Root, Value>

Creates a reference-writable path while capturing its complete focus type token at the call site.

@JvmName(name = "arrayReferenceWritableKeyPathAt")
inline fun <Value> referenceWritableKeyPath(noinline get: (Array<Value>, Int) -> Value, noinline set: (Array<Value>, Int, Value) -> Unit, at: Int): ReferenceWritableKeyPath<Array<Value>, Value>

Creates an in-place path through an Array's indexed get and set operations at at.

@JvmName(name = "mutableListReferenceWritableKeyPathAt")
inline fun <Value> referenceWritableKeyPath(noinline get: (MutableList<Value>, Int) -> Value, noinline set: (MutableList<Value>, Int, Value) -> Unit, at: Int): ReferenceWritableKeyPath<MutableList<Value>, Value>

Creates an in-place path through a MutableList's indexed get and set operations at at.

inline fun <Root : Any, Value> referenceWritableKeyPath(name: String, noinline get: (Root) -> Value, noinline set: (Root, Value) -> Unit): ReferenceWritableKeyPath<Root, Value>

Creates a custom in-place writable path with a root-local stable name.

fun <Root : Any, Value> referenceWritableKeyPath(property: KMutableProperty1<Root, Value>, id: PathId, valueType: TypeId, rootClass: KClass<*>? = null): ReferenceWritableKeyPath<Root, Value>

Adapts a mutable Kotlin property reference into an in-place mutable path.

fun <Root : Any, Value> referenceWritableKeyPath(id: PathId, valueType: TypeId, get: (Root) -> Value, set: (Root, Value) -> Unit, rootClass: KClass<*>? = null): ReferenceWritableKeyPath<Root, Value>

Creates a path whose replacement mutates the supplied root instance.

Link copied to clipboard

Intentionally treats a matched null value as another nonmatch.

Link copied to clipboard
fun <Root, Value> Root.set(keyPath: WritableKeyPath<Root, Value>, value: Value): Root

Replaces keyPath's focus and returns the resulting root.

operator fun <Root : Any, Value> Root.set(path: ReferenceWritableKeyPath<Root, Value>, value: Value)

In-place assignment shorthand for a reference-writable path.

Link copied to clipboard
fun <Root, Value> Root.setting(keyPath: WritableKeyPath<Root, Value>, value: Value): Root

Kotlin-friendly semantic spelling of set for value-style updates.

Link copied to clipboard

Kotlin-friendly spelling of CaseKeyPath.

Kotlin-friendly spelling of appending.

Kotlin-friendly spelling of reference-writable appending.

Kotlin-friendly spelling of writable appending.

Link copied to clipboard

Kotlin-friendly spelling of optional key-path appendingOptional.

Link copied to clipboard

Captures a Triple's complete component type tokens from a reified Kotlin context.

Link copied to clipboard
inline fun <MapKey, Value> writableKeyPath(noinline get: (Map<MapKey, Value>, MapKey) -> Value?, key: MapKey): WritableKeyPath<Map<MapKey, Value>, Value?>

Creates a copy-based path through a Map's lookup operation at key.

inline fun <Root : Any, Value> writableKeyPath(property: KMutableProperty1<Root, Value>, noinline copy: (Root) -> Root): WritableKeyPath<Root, Value>

Adapts a mutable property reference while inferring its identity and complete type tokens.

inline fun <Root, Value> writableKeyPath(get: KProperty1<Root, Value>, noinline set: (Root, Value) -> Root): WritableKeyPath<Root, Value>

Adapts a property reference into a copy-based writable path while inferring its identity and complete type tokens.

inline fun <Root, Value> writableKeyPath(id: PathId, noinline get: (Root) -> Value, noinline set: (Root, Value) -> Root): WritableKeyPath<Root, Value>

Creates a copy-based writable path while capturing its complete focus type token at the call site. Its root type is part of the caller-supplied PathId.

inline fun <Root, Value> writableKeyPath(name: String, noinline get: (Root) -> Value, noinline set: (Root, Value) -> Root): WritableKeyPath<Root, Value>

Creates a custom copy-based writable path with a root-local stable name.

fun <Root, Value> writableKeyPath(id: PathId, valueType: TypeId, get: (Root) -> Value, set: (Root, Value) -> Root): WritableKeyPath<Root, Value>

Creates a copy-based writable path with an explicitly supplied structural identity and type token.

fun <Root : Any, Value> writableKeyPath(property: KMutableProperty1<Root, Value>, id: PathId, valueType: TypeId, copy: (Root) -> Root): WritableKeyPath<Root, Value>

Adapts a mutable property reference into a copy-based writable path.

Adapts a property reference into a copy-based writable path with an explicitly supplied reconstruction operation.