# `Skuld.Effects.FreshInt`
[🔗](https://github.com/mccraigmccraig/skuld/blob/main/lib/skuld/effects/fresh_int.ex#L1)

FreshInt effect — generate monotonically increasing integers.

Zero dependencies. The handler stores a seed value in env state,
returns it, and increments. Both test and production handlers use
the same counter implementation — deterministic by default, no
external library needed.

## Production Usage

    comp do
      id <- FreshInt.fresh_integer()
      id
    end
    |> FreshInt.with_handler()
    |> Comp.run!()
    #=> 0

## Test Usage (Deterministic)

    comp do
      id <- FreshInt.fresh_integer()
      id
    end
    |> FreshInt.with_handler(seed: 100)
    |> Comp.run!()
    #=> 100  (deterministic, reproducible)

# `state_key`

# `with_handler`

```elixir
@spec with_handler(
  Skuld.Comp.Types.computation(),
  keyword()
) :: Skuld.Comp.Types.computation()
```

Install a FreshInt handler.

## Options

- `:seed` — starting integer value (default: 0)

---

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