// ets_tracing: off import * as CK from "../../../Collections/Immutable/Chunk/index.js" import type { Predicate } from "../../../Function/index.js" import * as CH from "../Channel/index.js" import * as C from "./core.js" export function dropWhile( p: Predicate ): C.Sink { const loop: CH.Channel< unknown, Err, CK.Chunk, unknown, Err, CK.Chunk, any > = CH.readWith( (in_) => { const leftover = CK.dropWhile_(in_, p) const more = CK.isEmpty(leftover) return more ? loop : CH.zipRight_(CH.write(leftover), CH.identity, any>()) }, (_) => CH.fail(_), (_) => CH.unit ) return new C.Sink(loop) }