Effect, one function at a time

Six short lessons, one Effect function each, in the order I would teach them to a colleague.

Each lesson covers one function from Effect and shows it in a small TypeScript snippet. Read them in order; each one assumes the ones before it.

Lessons

  1. 01
    Sequence steps with Effect.gen

    Write sequential Effect code with yield*.

  2. 02
    Wrap a promise with Effect.tryPromise

    Turn a promise that can fail into an Effect.

  3. 03
    Recover one error with Effect.catchTag

    Recover from one tagged error and leave the others alone.

  4. 04
    Feed a layer with Layer.provide

    Feed one layer's output into another layer.

  5. 05
    Stop waiting with Effect.timeout

    Stop waiting after a deadline.

  6. 06
    Try again with Effect.retry

    Run the effect again after a failure.