flatMap<O2> method

Conveyor<F, O2> flatMap<O2>(
  1. covariant Function1<O, Conveyor<F, O2>> f
)
override

Implementation

Conveyor<F, O2> flatMap<O2>(Function1<O, Conveyor<F, O2>> f) =>
    interpret((h, t) => tryOrDie(() => (f(h).onHalt((err) => err == End ? halt(End) : kill<O2>().plus(halt(err)))).lazyPlus(() => t.flatMap(f))),
        (req, recv) => consume(req, (ea) => recv(ea).flatMap(f)),
        halt);