```python
def index_map(labels: list) -> dict:
    """Return a mapping from each label to every position it holds."""
    return {label: [i for i, x in enumerate(labels) if x == label] for label in set(labels)}
```