# Array/Collection Utilities (`arr`)

Laravel Collection-inspired array manipulation with generic operations.

## Features

- **Transformation**: `map`, `filter`, `reduce`, `chunk`, `flatten`, `compact`
- **Query**: `first`, `last`, `find`, `get`, `some`, `every`, `contains`
- **Set operations**: `unique`, `diff`, `intersect`, `without`, `merge`
- **Shuffling**: `shuffle` (feature: `random`)

## Quick Start

```rust
use rok_utils::arr::{map, filter, find};

let numbers = [1, 2, 3, 4, 5];

let doubled = map(&numbers, |x| x * 2);
// [2, 4, 6, 8, 10]

let evens = filter(&numbers, |x| x % 2 == 0);
// [2, 4]

let found = find(&numbers, |x| *x == 3);
// Some(3)
```

## Set Operations

```rust
use rok_utils::arr::{unique, diff, intersect};

let a = [1, 2, 3, 2, 1];

unique(&a);     // [1, 2, 3]
diff(&a, &[2]); // [1, 3]
intersect(&a, &[2, 3]); // [2, 3]
```

## Chunking and Flipping

```rust
use rok_utils::arr::{chunk, reverse};

let numbers = [1, 2, 3, 4, 5, 6];

chunk(&numbers, 2);  // [[1, 2], [3, 4], [5, 6]]
reverse(&numbers);   // [6, 5, 4, 3, 2, 1]
```

## Feature Flags

| Feature | Description |
|---------|-------------|
| `full` | Enable all features |
| `random` | Enable `shuffle` function |

## See Also

- [Main examples](../docs/examples.md)
