commonMain.arrow.optics.dsl.option.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arrow-optics-jvm Show documentation
Show all versions of arrow-optics-jvm Show documentation
Functional companion to Kotlin's Standard Library
package arrow.optics.dsl
import arrow.core.Option
import arrow.optics.Fold
import arrow.optics.Iso
import arrow.optics.Lens
import arrow.optics.Optional
import arrow.optics.Prism
import arrow.optics.Setter
import arrow.optics.Traversal
/**
* DSL to compose a [Prism] with focus [arrow.core.Some] with a [Lens] with a focus of [Option]<[S]>
*
* @receiver [Lens] with a focus in [Option]<[S]>
* @return [Optional] with a focus in [S]
*/
public inline val Lens>.some: Optional inline get() = this.compose(Prism.some())
/**
* DSL to compose a [Prism] with focus [arrow.core.Some] with a [Iso] with a focus of [Option]<[S]>
*
* @receiver [Iso] with a focus in [Option]<[S]>
* @return [Prism] with a focus in [S]
*/
public inline val Iso>.some: Prism inline get() = this.compose(Prism.some())
/**
* DSL to compose a [Prism] with focus [arrow.core.Some] with a [Prism] with a focus of [Option]<[S]>
*
* @receiver [Prism] with a focus in [Option]<[S]>
* @return [Prism] with a focus in [S]
*/
public inline val Prism>.some: Prism inline get() = this.compose(Prism.some())
/**
* DSL to compose a [Prism] with focus [arrow.core.Some] with a [Optional] with a focus of [Option]<[S]>
*
* @receiver [Optional] with a focus in [Option]<[S]>
* @return [Optional] with a focus in [S]
*/
public inline val Optional>.some: Optional inline get() = this.compose(Prism.some())
/**
* DSL to compose a [Prism] with focus [arrow.core.Some] with a [Setter] with a focus of [Option]<[S]>
*
* @receiver [Setter] with a focus in [Option]<[S]>
* @return [Setter] with a focus in [S]
*/
public inline val Setter>.some: Setter inline get() = this.compose(Prism.some())
/**
* DSL to compose a [Prism] with focus [arrow.core.Some] with a [Traversal] with a focus of [Option]<[S]>
*
* @receiver [Traversal] with a focus in [Option]<[S]>
* @return [Traversal] with a focus in [S]
*/
public inline val Traversal>.some: Traversal inline get() = this.compose(Prism.some())
/**
* DSL to compose a [Prism] with focus [arrow.core.Some] with a [Fold] with a focus of [Option]<[S]>
*
* @receiver [Fold] with a focus in [Option]<[S]>
* @return [Fold] with a focus in [S]
*/
public inline val Fold>.some: Fold inline get() = this.compose(Prism.some())
© 2015 - 2025 Weber Informatics LLC | Privacy Policy