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

arrow.data.Coreader.kt Maven / Gradle / Ivy

package arrow.data

import arrow.core.*

fun  ((A) -> B).coreader(): CoreaderT = Coreader(this)

fun  CoreaderT.runId(d: A): B = this.run(Id(d))

object Coreader {
    operator fun  invoke(run: (A) -> B): CoreaderT = Cokleisli({ a: IdKind -> run(a.ev().value) })

    fun  pure(x: B): CoreaderT = Cokleisli.pure(x)

    fun  ask(): CoreaderT = Cokleisli.ask()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy