commonMain.arrow.optics.std.list.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arrow-optics Show documentation
Show all versions of arrow-optics Show documentation
Functional companion to Kotlin's Standard Library
The newest version!
package arrow.optics
import arrow.optics.typeclasses.Cons
import arrow.optics.typeclasses.Index
import arrow.optics.typeclasses.Snoc
public operator fun PLens, List>.get(i: Int): POptional =
Index.list().run { [email protected](i) }
public infix fun A.cons(tail: List): List =
Cons.list().run { [email protected](tail) }
public fun List.uncons(): Pair>? =
Cons.list().run { [email protected]() }
public infix fun List.snoc(last: A): List =
Snoc.list().run { [email protected](last) }
public fun List.unsnoc(): Pair, A>? =
Snoc.list().run { [email protected]() }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy