materialize<F, O> static method

F materialize<F, O>(
  1. Conveyor<Nowhere, O> s,
  2. ApplicativePlus<F> ap
)

Implementation

static F materialize<F, O>(Conveyor<Nowhere, O> s, ApplicativePlus<F> ap) =>
    s.interpret((h, t) => ap.prependElement(materialize(t, ap), h),
        (req, recv) => materialize(recv(left(Conveyor.End)), ap),
        (err) => err == Conveyor.End ? ap.empty() : throw err);