now
Creates an Eval instance from an already constructed value but still defers evaluation when chaining expressions with map
and flatMap
Parameters
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
}
Content copied to clipboard
It will return 2.