arrow-core-data / arrow.core / Eval / now
@JvmStatic fun <A> now(a: A):
Eval
<A>
Creates an Eval instance from an already constructed value but still defers evaluation when chaining expressions with map
and flatMap
a
-
is an already computed value of type A
import arrow.core.*
fun main() {
//sampleStart
val eager = Eval.now(1).map { it + 1 }
println(eager.value())
//sampleEnd
}
It will return 2.
Do you like Arrow?
✖