MCPcopy Create free account
hub / github.com/Effect-TS/effect / foldWeightedEffect

Function foldWeightedEffect

packages/effect/src/internal/sink.ts:1235–1246  ·  view source on GitHub ↗
(
  options: {
    readonly initial: S
    readonly maxCost: number
    readonly cost: (s: S, input: In) => Effect.Effect<number, E, R>
    readonly body: (s: S, input: In) => Effect.Effect<S, E2, R2>
  }
)

Source from the content-addressed store, hash-verified

1233
1234/** @internal */
1235export const foldWeightedEffect = <S, In, E, R, E2, R2>(
1236 options: {
1237 readonly initial: S
1238 readonly maxCost: number
1239 readonly cost: (s: S, input: In) => Effect.Effect<number, E, R>
1240 readonly body: (s: S, input: In) => Effect.Effect<S, E2, R2>
1241 }
1242): Sink.Sink<S, In, In, E | E2, R | R2> =>
1243 foldWeightedDecomposeEffect({
1244 ...options,
1245 decompose: (input) => Effect.succeed(Chunk.of(input))
1246 })
1247
1248const foldWeightedDecomposeEffectLoop = <S, In, E, R, E2, R2, E3, R3>(
1249 s: S,

Callers

nothing calls this directly

Calls 2

ofMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…