https://kotlinlang.org logo
#arrow
Title
# arrow
r

raulraja

03/04/2018, 1:34 PM
@stepango The main
invoke
on
IO
delays the computation suspending it and handles exceptions:
Copy code
val value = IO.monad().binding {
  val delayedResult1 = IO { delayedComputation() }.bind()
  val delayedResult2 = IO { delayedComputation() }.bind()
  delayedResult1 + delayedResult2
}
That won't ever be executed until you call
value.unsafeRunAsync
or
value.unsafeRunSync
. Is that what you were referring to with
delay
?