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

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

There is a newer version: 2.0.1-alpha.1
Show newest version
package arrow.optics.dsl

import arrow.optics.Every
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 [Traversal] with a [Lens] for a structure [S] to see all its foci [A]
 *
 * @receiver [Lens] with a focus in [S]
 * @param TR [Traversal] that can focus into a structure [S] to see all its foci [A]
 * @return [Traversal] with a focus in [A]
 */
public fun  Lens.every(TR: Every): Every = this.compose(TR)

/**
 * DSL to compose [Traversal] with an [Iso] for a structure [S] to see all its foci [A]
 *
 * @receiver [Iso] with a focus in [S]
 * @param TR [Traversal] that can focus into a structure [S] to see all its foci [A]
 * @return [Traversal] with a focus in [A]
 */
public fun  Iso.every(TR: Every): Every = this.compose(TR)

/**
 * DSL to compose [Traversal] with a [Prism] for a structure [S] to see all its foci [A]
 *
 * @receiver [Prism] with a focus in [S]
 * @param TR [Traversal] that can focus into a structure [S] to see all its foci [A]
 * @return [Traversal] with a focus in [A]
 */
public fun  Prism.every(TR: Every): Every = this.compose(TR)

/**
 * DSL to compose [Traversal] with an [Optional] for a structure [S] to see all its foci [A]
 *
 * @receiver [Optional] with a focus in [S]
 * @param TR [Traversal] that can focus into a structure [S] to see all its foci [A]
 * @return [Traversal] with a focus in [A]
 */
public fun  Optional.every(TR: Every): Every = this.compose(TR)

/**
 * DSL to compose [Traversal] with a [Setter] for a structure [S] to see all its foci [A]
 *
 * @receiver [Setter] with a focus in [S]
 * @param TR [Traversal] that can focus into a structure [S] to see all its foci [A]
 * @return [Setter] with a focus in [A]
 */
public fun  Setter.every(TR: Every): Setter = this.compose(TR)

/**
 * DSL to compose [Traversal] with a [Traversal] for a structure [S] to see all its foci [A]
 *
 * @receiver [Traversal] with a focus in [S]
 * @param TR [Traversal] that can focus into a structure [S] to see all its foci [A]
 * @return [Traversal] with a focus in [A]
 */
public fun  Traversal.every(TR: Every): Traversal = this.compose(TR)

/**
 * DSL to compose [Traversal] with a [Fold] for a structure [S] to see all its foci [A]
 *
 * @receiver [Fold] with a focus in [S]
 * @param TR [Traversal] that can focus into a structure [S] to see all its foci [A]
 * @return [Fold] with a focus in [A]
 */
public fun  Fold.every(TR: Every): Fold = this.compose(TR)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy