# Welcome to Effect

Effect is a TypeScript library for building production-grade software: typed
error handling, structured concurrency, resource safety, and observability,
all from one composable core.

## Why Effect?

### Typed data, untyped programs

TypeScript is excellent at describing your data, but it says almost nothing about your programs: a function's signature doesn't tell you what can fail, what dependencies it needs, or whether it can be safely retried, timed out, or interrupted. As applications grow, teams end up hand-rolling those guarantees with ad-hoc try/catch, unstructured promises, and libraries that don't compose.

### Programs as values

Effect closes that gap with a single building block: the `Effect` type, a value that fully describes a program, including its success value, its possible errors, and its requirements. Because programs are values, they compose: retries, timeouts, concurrency, resource handling, and tracing are operators you apply, not architectures you rebuild.

Out of the box

- **Typed errors**: Failures live in the signature and are handled like data.
- **Retries and scheduling**: Backoff policies you compose instead of loops you write.
- **Structured concurrency**: Bounded parallel work that cleans up after itself.
- **Resource safety**: Acquisition and release are guaranteed, even when things fail.
- **Dependency injection**: Services wired through the type system, trivial to swap in tests.
- **Observability**: Tracing, metrics, and structured logging built into the runtime.
- **Streaming**: Backpressured streams that use the same operators as everything else.
- **Schema validation**: Parse and transform data with types that match reality.
- **Configuration**: Typed config from the environment, validated at startup, secrets redacted.
- **A consistent ecosystem**: HTTP, SQL, CLI, AI, and platform packages built on the same core.

### Built for the AI era

The AI era raises the stakes. When coding agents write a growing share of your software, the bottleneck moves from writing code to trusting it. Effect makes a program's failure modes, dependencies, and lifecycle visible to the compiler, turning runtime surprises into precise feedback an agent can act on. And when the thing you are building is itself an AI application, flaky providers, retries, streaming, and rate limits are exactly the problems Effect solves out of the box.

## Your Learning Path

Effect rewards learning in order: each step builds on the one before it. Following this spine takes most developers a few focused days; everything else branches off from it.

- [01 Understand the core idea An Effect is a value that describes a program: what it produces, how it can fail, and what it needs to run. Everything else builds on this one type. The Effect Type →](/docs/v4/getting-started/the-effect-type)
- [02 Set up your project Install the library and configure TypeScript. Effect is a single dependency with zero required tooling. Installation →](/docs/v4/getting-started/installation)
- [03 Write your first program Create effects, compose them with generators, and run them at the edge of your app. Creating Effects →](/docs/v4/getting-started/creating-effects)
- [04 Handle errors the Effect way Errors are typed values, not surprises. Learn expected vs unexpected failures, fallbacks, and retries. Two Types of Errors →](/docs/v4/error-management/two-error-types)
- [05 Go concurrent Run effects in parallel with bounded concurrency, race them, and let structured concurrency clean up after you. Basic Concurrency →](/docs/v4/concurrency/basic-concurrency)

Here's the kind of program you'll be writing within the first hour:

```ts
import { Effect } from "effect"

const program = Effect.gen(function* () {
  const name = yield* Effect.succeed("world")
  yield* Effect.log("Hello, " + name + "!")
})

Effect.runPromise(program)
```

## Keep Going

- [Guides → The in-depth documentation: every topic from pipelines to PubSub, structured to read in order or dip into.](/docs/v4/getting-started)
- [Reference → The complete API reference for every Effect module, versioned per release.](/docs/v4/api)
- [Playground → Run Effect in your browser with a full editor, no local setup needed. Ideal as a second tab while you learn.](/play)

## Join our Community

The Effect community lives on [Discord](https://discord.gg/effect-ts): the core team and experienced users are there daily, and no question goes unanswered.
