arrow-optics / arrow.optics.extensions / ListKSnoc

ListKSnoc

@extension interface ListKSnoc<A> : Snoc<ListK<A>, A>

Snoc instance definition for ListK.

Inherited Properties

init open val S.init: Option<S>
Selects all elements except the last.

Functions

snoc open fun snoc(): Prism<ListK<A>, Tuple2<ListK<A>, A>>
Provides a Prism between a S and its init and last element A.

Inherited Functions

initOption open fun initOption(): Optional<S, S>
Provides an Optional between S and its init S.
lastOption open fun lastOption(): Optional<S, A>
Provides an Optional between S and its last element A.
snoc open infix fun S.snoc(last: A): S
Append an element A to S.
unsnoc open fun S.unsnoc(): Option<Tuple2<S, A>>
Deconstruct an S between its init and last element.