import * as Tp from "../../../../Collections/Immutable/Tuple";
import * as T from "../../../../Effect";
import * as O from "../../../../Option";
import * as UnfoldChunkEffect from "./unfoldChunkEffect";
/**
 * Creates a stream from an effect producing chunks of `A` values until it fails with None.
 */

export function repeatEffectChunkOption(fa) {
  return UnfoldChunkEffect.unfoldChunkEffect(undefined, _ => {
    return T.catchAll_(T.map_(fa, chunk => O.some(Tp.tuple(chunk, undefined))), O.fold(() => T.none, e => T.fail(e)));
  });
}
//# sourceMappingURL=repeatEffectChunkOption.js.map