effect-io-ai

Package: effect
Module: Effect

Effect.fnUntracedEager

Creates untraced function effects with eager evaluation optimization.

Details

Executes generator functions eagerly when all yielded effects are synchronous, stopping at the first async effect and deferring to normal execution.

Example (Defining eager untraced effect functions)

import { Effect } from "effect"

const computation = Effect.fnUntracedEager(function*() {
  yield* Effect.succeed(1)
  yield* Effect.succeed(2)
  return "computed eagerly"
})

const effect = computation() // Executed immediately if all effects are sync

Signature

declare const fnUntracedEager: fn.Untraced

Source

Since v4.0.0