# Data Types

Effect ships a small set of immutable, value-oriented data types that show up
everywhere in real code. They are plain data — pure, structurally comparable,
and safe to share — and many of them interoperate directly with `Effect` (an
`Option` or a `Result` can be `yield*`-ed inside `Effect.gen`).

This section covers the types you reach for most often:

- **[Option](https://effect.plants.sh/data-types/option/)** — model a value that may be absent
  (`Some<A>` or `None`) instead of using `null`/`undefined`.
- **[Result](https://effect.plants.sh/data-types/result/)** — a synchronous success-or-failure value
  (`Success<A, E>` or `Failure<A, E>`). This is v4's replacement for `Either`.
- **[Exit and Cause](https://effect.plants.sh/data-types/exit-and-cause/)** — the full result of
  *running* an effect: a success value, or a `Cause` that captures expected
  failures, defects, and interruptions.
- **[Chunk](https://effect.plants.sh/data-types/chunk/)** — an immutable, high-performance sequence used
  throughout [Streaming](https://effect.plants.sh/streaming/).
- **[Data](https://effect.plants.sh/data-types/data/)** — base classes that give your structs and tagged
  unions automatic value equality.
- **[DateTime and Duration](https://effect.plants.sh/data-types/datetime-and-duration/)** — time-zone
  aware instants and a precise representation of spans of time.
- **[BigDecimal](https://effect.plants.sh/data-types/bigdecimal/)** — arbitrary-precision decimal
  arithmetic without floating-point rounding errors.
- **[Brand](https://effect.plants.sh/data-types/branded-types/)** — nominal types that distinguish
  values sharing the same underlying representation (e.g. `UserId` vs `number`).
- **[Redacted](https://effect.plants.sh/data-types/redacted/)** — wrap secrets so they never leak into
  logs, errors, or stack traces.

## Why value types?

Two themes recur across these types and explain why Effect prefers them over
raw JavaScript primitives:

**Absence and failure are values, not exceptions.** Rather than throwing or
returning `null`, partial computations return an `Option` or a `Result`. The
type signature then tells the truth about what can happen, and the compiler
forces you to handle every case.

**Equality is structural.** Types built on [Data](https://effect.plants.sh/data-types/data/) (and
`Chunk`, `Option`, `Result`, `Duration`, …) compare by *value*, not by
reference. Two separately constructed instances holding the same data are
`Equal.equals`, which makes them safe to use as keys in `HashMap`/`HashSet` and
to compare in tests.

```ts
import { Data, Equal } from "effect"

class Point extends Data.Class<{ readonly x: number; readonly y: number }> {}

// Two distinct objects, structurally equal
console.log(Equal.equals(new Point({ x: 1, y: 2 }), new Point({ x: 1, y: 2 })))
// Output: true
```

Pick the page for the type you need — each one leads with a realistic example
and explains the operations you will actually use.