Effect TS · Lesson 1 of 8

What problem does Effect actually solve?

A mental model for a decision, not a syntax tour. You'll leave able to run your first Effect program and say precisely what it replaces.

Your mission

You're evaluating Effect for your next service — a brand-new project where you pick the tools freely. This course ends with you writing an adopt-or-reject memo: a short document arguing for or against Effect, backed by a small working piece of a real service you build along the way. Lesson 1 gives you the mental model every later lesson builds on — and your first runnable program.

The one idea: an Effect is a description, not a program

Calling Effect.succeed(42) does nothing. It returns a value that describes a computation — like a recipe card, not a cooked meal. Nothing happens until you hand the recipe to a runner such as Effect.runPromise1.

// recipe written, kitchen still cold
const program = Effect.succeed(42);

// NOW it runs
await Effect.runPromise(program); // → 42

You already know this shape: it's the difference between () => fetch(url) and fetch(url). Effect just makes every operation lazy like that — and laziness is what lets it add powers plain promises can't have: typed errors (failures listed in the type — lesson 2), retries and timeouts (lesson 3), dependency injection (pluggable parts — lesson 4), and test clocks (faking the passage of time in tests). Because a description is just data, Effect can inspect it and combine descriptions before anything runs2.

Check yourself

If you can't say "nothing runs until runPromise", re-read this section before the quiz. Everything else in Effect falls out of this one fact.

You have already built Effect, by hand

In the Meridian course you built by hand the exact problems Effect packages up and sells as solved. That's exactly why you can evaluate it quickly: you know the pain it offers relief from.

You hand-rolled (plain TS)Effect's packaged answerLesson
Errors as a list of named cases (a discriminated union), passed up through return types by handEvery effect carries an error channel — the second slot in Effect<A, E> — tracked automatically32
withRetry loops that wait longer after each failed attempt (your BullMQ work)Reusable Schedule values — retry plans as data: Effect.retry(effect, policy)43
Functional core / imperative shell — pure logic inside, messy input/output at the edges — with dependencies passed in as parametersContext.Tag + Layer — pluggable parts you can swap for test doubles54
Checking data at the door ("parse, don't validate"): functions that build a valid value or refuse the inputSchema: define the shape once, get the runtime checks and the TypeScript types from it65

The evaluator's question is not "is this clever?" — it clearly is. It's "does the packaged version beat my hand-built one often enough to be worth its learning curve?" Watch both sides as we go.

The composition payoff, in one comparison

Here's the shape of the bet. Left: the retry helper you've written per project. Right: the same behaviour as a value you can hand to any effect — HTTP call, queue write, DB query — no wrapper, no loop.

By hand (your current world)
async function withRetry<T>(
  fn: () => Promise<T>
): Promise<T> {
  let delay = 100;
  for (let i = 0; ; i++) {
    try { return await fn(); }
    catch (e) {
      if (i >= 4) throw e;
      await sleep(delay);
      delay *= 2;
    }
  }
}

// ...and a second copy for timeouts,
// and a third for logging...
Effect — cross-cutting concern as a value
import { Effect, Schedule } from 'effect';

const policy = Schedule.recurs(5);

// any effect, one line:
const program =
  chargeCard.pipe(Effect.retry(policy));

// compose more powers by adding
// combinators — not by rewriting
// the loop:
// Effect.timeout("5 seconds")

Doubling waits ("exponential backoff"), a dash of randomness ("jitter"), a hard limit on attempts ("capped retries") — each is just another Schedule piece you snap on, which we'll assemble properly in lesson 3. The point now: the retry policy is data, so you can build with it. Your loop, however tidy, can't be handed around.

Run your first program

Sandbox · Effect.gen
Version horizon (matters for your verdict)

This course teaches stable version 3 (3.22.1). Effect 4 is in release candidate — a near-final preview: fine to try, not yet the safe default7. In v4, the packages fold into one dependency-free effect package, and Either is renamed Result8. The concepts you learn here carry over almost unchanged. But "adopt now on v3 and migrate at v4" versus "wait for v4" is exactly the kind of judgement your final memo should make.

Read one thing

Primary source

Official docs, about 15 minutes: Creating Effects, then Using Generators. Read them after the quiz — they'll confirm what you proved here. Prefer video? Matt Pocock's onboarding pitch is the best skeptic's framing of the same bet.

Prove it before you move on

1 · The problem 2 · Typed errors 3 · Schedules & retries 4 · Services & Layers 5 · Schema 6 · HTTP with @effect/platform 7 · Concurrency 8 · The verdict memo
Your teacher

Anything unclear — the generator syntax, why laziness enables retries, what "description" really means — ask me before starting lesson 2. No question is too small; I designed this path for you and can re-route it anytime. When you're ready to hear how real teams live with Effect, the official Discord is where maintainers answer daily.

Next: Typed errors — making failure a value →