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

commonMain.arrow.optics.dsl.option.kt Maven / Gradle / Ivy

There is a newer version: 2.0.1-alpha.1
Show newest version
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