arrow-fx / arrow.fx / IO / followedBy

followedBy

fun <B> followedBy(fb: IOOf<B>): IO<B>

Compose this IO with another IO while ignoring the output.

import arrow.fx.IO

fun main(args: Array<String>) {
  //sampleStart
  val result = IO.effect { println("Hello World!") }
    .followedBy(IO.effect { println("Goodbye World!") })
  //sampleEnd
  println(result.unsafeRunSync())
}

See Also

flatMap

Do you like Arrow?

Arrow Org
<