Hyperlinkv0.8.0-beta.28

Effect

Effect.Doconsteffect/Effect.ts:1252
Effect<{}, never, never>

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)
)
do notation
Source effect/Effect.ts:12521 lines
export const Do: Effect<{}> = internal.Do