# IndexSet

`import { IndexSet } from "destack:ops";`

Interface for index assignment `a[i] = v`.

`a[i] = v` becomes `a.indexSet(i, v)` through an exclusive receiver.

Types that implement `IndexSet` should typically also implement `Index`.

```ds title="IndexSet"
export newtype interface IndexSet<I, V> {
    indexSet(key: I, value: V): void;
}
```

[language/library/src/ops/subscript.ds:29:32](https://github.com/destack-sh/destack/blob/main/language/library/src/ops/subscript.ds#L29-L32)

## Members

### `indexSet(key: I, value: V): void`

Store `value` at `key`.
