All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.arrow.optics.std.list.kt Maven / Gradle / Ivy

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