```fun repl(state: State): IO<State> = IO.fx...
# arrow
p
Copy code
fun repl(state: State): IO<State> = IO.fx {
  val input = getInput().bind() // read
  val nextState = operateOnInput(state, input).bind() // eval & print
  if (!nextState.isEnd()) {
    repl(nextState).bind()  // loop
  }
}