index

fun <T, S, I, A> Optional<T, S>.index(idx: Index<S, I, A>, i: I): Optional<T, A>

DSL to compose Index with an Optional for a structure S to focus in on A at given index I

Receiver

Optional, Lens, or Prism with a focus in S

Return

Optional with a focus in A at given index I

Parameters

idx

Index instance to provide a Optional to focus into S at I

i

index I to focus into S and find focus A


fun <T, S, I, A> Traversal<T, S>.index(idx: Index<S, I, A>, i: I): Traversal<T, A>

DSL to compose Index with a Traversal for a structure S to focus in on A at given index I

Receiver

Traversal with a focus in S

Return

Traversal with a focus in A at given index I.

Parameters

idx

Index instance to provide a Optional to focus into S at I

i

index I to focus into S and find focus A


fun <T, A> Optional<T, List<A>>.index(index: Int): Optional<T, A>
fun <T, A> Traversal<T, List<A>>.index(index: Int): Traversal<T, A>
@JvmName(name = "indexNonEmptyList")
fun <T, A> Optional<T, NonEmptyList<A>>.index(index: Int): Optional<T, A>
@JvmName(name = "indexNonEmptyList")
fun <T, A> Traversal<T, NonEmptyList<A>>.index(index: Int): Traversal<T, A>
@JvmName(name = "indexValues")
fun <T, K, A> Optional<T, Map<K, A>>.index(key: K): Optional<T, A>
@JvmName(name = "indexValues")
fun <T, K, A> Traversal<T, Map<K, A>>.index(key: K): Traversal<T, A>
@JvmName(name = "indexSequence")
fun <T, A> Optional<T, Sequence<A>>.index(index: Int): Optional<T, A>
@JvmName(name = "indexSequence")
fun <T, A> Traversal<T, Sequence<A>>.index(index: Int): Traversal<T, A>
@JvmName(name = "indexString")
fun <T> Optional<T, String>.index(index: Int): Optional<T, Char>
@JvmName(name = "indexString")
fun <T> Traversal<T, String>.index(index: Int): Traversal<T, Char>