0Pricing
TypeScript Academy · Lesson

Why Effect Systems Matter

Make side effects and failures explicit and composable.

Why Effect Systems Matter

An effect system makes side effects, failures, and dependencies explicit and composable in the type system. Instead of hidden throws and ambient I/O, every effect is a value you can pass around, transform, and combine.

Problems With Raw async/throw

Plain async/await with throw hides crucial information: the function signature does not say what errors it can throw or what resources it needs.

async function getUser(id: number): Promise<User> {
  // may throw NotFoundError, may throw NetworkError
  // needs a database connection from... somewhere
  // none of this is in the type
  return await db.users.find(id);
}

All lessons in this course

  1. Why Effect Systems Matter
  2. The Effect Type
  3. Composing Effects
  4. Error Channels and Dependencies
← Back to TypeScript Academy