Question
Implement an immutable-style array wrapper whose transformations are deferred until a terminal operation needs values.
```python
class LazyArray:
def __init__(self, array): ...
def map(self, function): ...
def index_of(self, target: int) -> int: ...
```
## Requirements
- `map` returns a new `LazyArray` and must not invoke the function immediately.
- Chained maps apply in declaration order.
- `index_of` evaluates original elements from left to right, stopping at the first transformed value equal to `target`; return that original index or `-1`.
- Branches sharing a prefix must not mutate or otherwise affect each other.
- Avoid evaluating elements after a match is found.
- Construction snapshots the finite input sequence. Later mutations of the caller's list do not change this wrapper or its branches.
- Each `index_of` call starts a fresh traversal; there is no result cache. An exception from a demanded transformation propagates immediately, without evaluating later elements or changing the pipeline. Side effects therefore repeat on repeated searches.
The provided `run_case` builds arithmetic pipelines for public fixtures. Implement the class interfaces, not a special-case answer in that adapter. Deferred execution, branch isolation and exception behavior are also requirements even when an arithmetic fixture does not observe them.
## Design discussion (not graded)
1. Add lazy `filter`, `take`, and iteration.
2. Memoize evaluated prefixes while preserving branch isolation.
3. Fuse compatible operations to reduce allocations.
4. Make the abstraction safe for infinite input streams.