MCPcopy
hub / github.com/Effect-TS/effect / collectAllToSetN

Function collectAllToSetN

packages/effect/src/internal/sink.ts:169–175  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

167
168/** @internal */
169export const collectAllToSetN = <In>(n: number): Sink.Sink<HashSet.HashSet<In>, In, In> =>
170 foldWeighted<HashSet.HashSet<In>, In>({
171 initial: HashSet.empty(),
172 maxCost: n,
173 cost: (acc, input) => HashSet.has(acc, input) ? 0 : 1,
174 body: (acc, input) => HashSet.add(acc, input)
175 })
176
177/** @internal */
178export const collectAllUntil = <In>(p: Predicate<In>): Sink.Sink<Chunk.Chunk<In>, In, In> => {

Callers

nothing calls this directly

Calls 2

foldWeightedFunction · 0.85
addMethod · 0.65

Tested by

no test coverage detected