# Conditions


CL-style condition system: signal/warn with restart-based recovery.

## `collectConditions`

_conditions.collectConditions: handler that accumulates each condition into state as `{ name, data }` and resumes with `continue`._

Collecting handler: accumulates conditions in state, resumes with continue.
State shape: list of { name, data }
Initial state: []

## `fail`

_conditions.fail: last-resort handler that throws on any condition (via `builtins.throw`); ignores available restarts._

Fail handler: throws on any condition. Ignores available restarts.
Use as a last-resort handler.

## `ignore`

_conditions.ignore: handler that silently discards every condition by resuming with `{ restart = "continue"; value = null; }`._

Ignore handler: resumes with null for any condition.
All conditions are silently discarded.

## `signal`

_signal: raise a CL-style condition with name, data, and available restart names; the handler returns `{ restart, value }` to choose recovery._

```
signal : string -> any -> [string] -> Computation any
```

Signal a condition. The handler chooses a restart strategy.

**Arguments:**
- `name` — condition name (e.g. `"division-by-zero"`, `"file-not-found"`)
- `data` — condition data (error details, context)
- `restarts` — list of available restart names

The handler receives `{ name, data, restarts }` and returns a
`{ restart, value }` attrset. The continuation receives this choice.

## `warn`

_warn: raise a warning condition with the conventional `muffle-warning` restart; if the handler doesn't muffle, computation continues._

```
warn : string -> any -> Computation null
```

Signal a warning condition. Like signal but with a conventional
`"muffle-warning"` restart. If the handler doesn't muffle, the
computation continues normally.

## `withRestart`

_withRestart: handler factory invoking a named restart with a given value for one matched condition; throws on every other condition._

```
withRestart : string -> string -> any -> handler
```

Create a handler that invokes a specific restart for a named condition.
For all other conditions, falls through (throws).

**Arguments:**
- `condName` — condition name to match
- `restartName` — restart to invoke
- `restartVal` — value to pass via the restart

