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

Function foldWeightedDecomposeEffect

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

Source from the content-addressed store, hash-verified

1209
1210/** @internal */
1211export const foldWeightedDecomposeEffect = <S, In, E, R, E2, R2, E3, R3>(
1212 options: {
1213 readonly initial: S
1214 readonly maxCost: number
1215 readonly cost: (s: S, input: In) => Effect.Effect<number, E, R>
1216 readonly decompose: (input: In) => Effect.Effect<Chunk.Chunk<In>, E2, R2>
1217 readonly body: (s: S, input: In) => Effect.Effect<S, E3, R3>
1218 }
1219): Sink.Sink<S, In, In, E | E2 | E3, R | R2 | R3> =>
1220 suspend(() =>
1221 new SinkImpl(
1222 foldWeightedDecomposeEffectLoop(
1223 options.initial,
1224 options.maxCost,
1225 options.cost,
1226 options.decompose,
1227 options.body,
1228 0,
1229 false
1230 )
1231 )
1232 )
1233
1234/** @internal */
1235export const foldWeightedEffect = <S, In, E, R, E2, R2>(

Callers 1

foldWeightedEffectFunction · 0.85

Calls 2

suspendFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…