lensOf

fun <T, I> lensOf(element: T, idProvider: IdProvider<T, I>): Lens<List<T>, T>

creates a Lens pointing to a certain element in a List

Parameters

element

current instance of the element to focus on

idProvider

to identify the element in the list (i.e. when it's content changes over time)


fun <T> lensOf(index: Int): Lens<List<T>, T>

creates a Lens pointing to a certain index in a list

Parameters

index

position to focus on


fun <K, V> lensOf(key: K): Lens<Map<K, V>, V>

creates a Lens pointing to a certain element in a Map

Parameters

key

of the entry to focus on