import * as tsplus_module_1 from "@effect/core/stream/Channel/operations/failCause";
import * as tsplus_module_2 from "@effect/core/io/Cause/operations/failureOrCause";
import * as tsplus_module_3 from "@tsplus/stdlib/data/Either/fold";
import * as tsplus_module_4 from "@effect/core/stream/Channel/operations/readWithCause";
/**
 * Reads an input and continue exposing both error and completion.
 *
 * @tsplus static ets/Channel/Ops readWith
 */

export function readWith(input, error, done) {
  return tsplus_module_4.readWithCause(input, cause => tsplus_module_3.fold_(tsplus_module_2.failureOrCause(cause), error, cause => tsplus_module_1.failCause(() => cause)), done);
}
//# sourceMappingURL=readWith.mjs.map