effect-io-ai

Package: effect
Module: Effect

Effect.let

Adds a computed plain value to the do notation record.

When to use

Use to add a derived, synchronous value to a do-notation pipeline when it depends on fields already accumulated in the record and does not need to run another Effect.

Details

The new field is added with object spreading. If the name already exists in the record, the computed value replaces it in the returned type.

See

Signature

declare const let: { <N extends string, A extends Record<string, any>, B>(name: N, f: (a: NoInfer<A>) => B): <E, R>(self: Effect<A, E, R>) => Effect<Simplify<Omit<A, N> & Record<N, B>>, E, R>; <A extends Record<string, any>, E, R, B, N extends string>(self: Effect<A, E, R>, name: N, f: (a: NoInfer<A>) => B): Effect<Simplify<Omit<A, N> & Record<N, B>>, E, R>; }

Source

Since v2.0.0