# `PtcRunner.Lisp.Runtime.Collection.Normalize`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/lisp/runtime/collection/normalize.ex#L1)

Predicate and collection normalization helpers for collection operations.

Collapses the combinatorial explosion of pred types x collection types
into two reusable normalization functions.

# `graphemes`

Convert string to list of graphemes.

# `normalize_keyfn`

Normalize a key/function to a 1-arity value-extracting function.

Same as `normalize_pred/2` with `:value` mode but with a different
vector error message ("function or key" vs "predicate").

# `normalize_pred`

Normalize a predicate to a 1-arity function.

Mode `:truthy` returns a boolean-coercing function (for filter, remove, find,
every?, not_any?, take_while, drop_while).
Mode `:value` returns a value-extracting function (for some, keep).

# `to_seq`

Normalize any collection to a list. Maps become `[k, v]` pairs.

# `vector_arg_error`

Raise a type error for vector used where predicate/function expected.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
