# `Reach.Effects`
[🔗](https://github.com/elixir-vibe/reach/blob/v2.2.0/lib/reach/effects.ex#L1)

Effect classification for IR nodes.

Classifies each expression by its side effects — pure computations,
IO, mutable state access, message passing, etc. Used by independence
queries to determine whether reordering is safe.

# `effect`

```elixir
@type effect() ::
  :pure | :read | :write | :io | :send | :receive | :exception | :nif | :unknown
```

# `classify`

```elixir
@spec classify(Reach.IR.Node.t()) :: effect()
```

Classifies the effect of an IR node.

# `conflicting?`

```elixir
@spec conflicting?(effect(), effect()) :: boolean()
```

Returns true if two effects conflict (reordering may change behavior).

# `effectful?`

```elixir
@spec effectful?(Reach.IR.Node.t(), effect()) :: boolean()
```

Returns true if the node has the given effect.

# `ensure_cache`

Ensures the effect-classification ETS cache exists.

# `infer_local_effects`

```elixir
@spec infer_local_effects(%{required(Reach.IR.Node.id()) =&gt; Reach.IR.Node.t()}) :: :ok
```

Infers effects for project-local functions by analyzing their call bodies.

Walks all function definitions and classifies each based on the effects
of its callees. Iterates until no new classifications are found (fixed-point).
Results are cached in the ETS classify cache.

# `pure?`

```elixir
@spec pure?(Reach.IR.Node.t()) :: boolean()
```

Returns true if the node is pure (no side effects).

# `pure_call?`

Returns true when a module/function/arity is classified as pure.

# `pure_modules`

Returns modules whose functions are pure by default unless explicitly listed otherwise.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
