effect-io-ai

Package: effect
Module: Effect

Effect.Do

Effect that succeeds with an empty record {}, used as the starting point for do notation chains.

Example (Starting do notation)

import { Effect, pipe } from "effect"

const program = pipe(
  Effect.Do,
  Effect.bind("x", () => Effect.succeed(2)),
  Effect.bind("y", ({ x }) => Effect.succeed(x + 1)),
  Effect.let("sum", ({ x, y }) => x + y)
)

Signature

declare const Do: Effect<{}, never, never>

Source

Since v2.0.0