lensForElement

fun <T, I> lensForElement(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> lensForElement(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> lensForElement(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