Skip to main content
@usenarrator/plugin-effect Effect code is dense. A single pipe can retry, time out, recover from two kinds of error and log along the way. The Effect plugin reads generators as a list of steps and pipes as numbered steps, so the control flow is visible at a glance.
The plugin only narrates Effect APIs in files that import from effect or belong to a package that depends on it (see Dependency detection), and picks the v3 or v4 reading from that dependency’s version unless version is pinned. That keeps unrelated code that happens to use names like Effect or Layer reading normally.

Examples

Generators and pipes
English
Error handling
English
Schema
English

Effect 3 and Effect 4

Some names mean different things in Effect 3 and Effect 4. By default the plugin reads both and uses a phrasing that is true for either. Pass version: 3 or version: 4 for the precise reading. Plugin versioning shows the difference for Schema.Date.

What it covers

  • Effect.gen generators, yield* steps, pipe as a method and as a function, and Effect.fn.
  • Constructors: succeed, fail, sync, promise, tryPromise, try.
  • Combinators: map, flatMap, tap, all, forEach (with concurrency), retry, timeout, catchTag, catchTags, catchAll, tapError, mapError, orElse, either.
  • Running: runPromise, runSync, runFork, runMain.
  • Services and layers: Context.Tag, Effect.Service, Effect 4’s Context.Service, Layer constructors and provideService.
  • Errors: Data.TaggedError and Schema tagged errors.
  • Option, Either and Result basics, Schedule, Stream constructors and sinks, scopes and finalizers, fibers and refs.
  • Schema: structs, optional fields, checks, literals, unions, classes and decoding.
More of Effect is being added. If you find an API that reads generically, it is probably not covered yet.

Translating

The English phrasebook is exported as en and typed as EffectPhrases.