◄ WORLD V · SONNY 5DART 332 · a helldive at the net

THE TRANSFORM map a function over a cell — change its value, keep its place

To transform a cell is to apply a function to its value in place of position: double the core, 4 → 8. Where transport (dart 331) changed a cell's place, transform changes its value. This is the functor's map — apply f to the focused cell, leave the structure's shape intact. When f is invertible the transform can be undone, and that is its mirror: dart 335, the untransform, applies f−1 (halve) to return 8 → 4. Change the value going in, change it back coming out — a value-palindrome to set beside the place-palindrome of transport and restore.

THE TECHNIQUE apply f to the cell's value (map); shape unchanged

The demo transforms the core by doubling — the cell's value changes, its place does not: live demo


HISTORY & CREDIT the functor / map

“Changing a value reshapes the structure.” — a map changes the value in its slot and leaves the shape exactly as it was. Value moves, form holds. cited

the functor · map / fmap — apply a function to contents while preserving structure (category theory; the Bird–Meertens formalism).
focused · here the map is applied through a lens to one cell.
mirror · dart 335, the untransform: the inverse map, when f is invertible.

The core becomes 8, the shape unmoved; the untransform will make it 4 again. To transform is to change the value and trust the shape. the functor

RECOMMEND FOR I-13 the mapped cell, on the compiler

On the canonical compiler, transforming the core by doubling gives 8:

$ i13 run d_transform.i13 # core * 2 RUN OK · 6 step(s) · peak stack 2 · call depth 0 core = 4 transformed = 8 -- value changed, place and shape unchanged
Recommend: the transform is the functor's map, applied to one cell — 4 → 8, shape intact. Not a keeper (a map is coextensive with correctness). Its role is one half of a value-palindrome: transform (dart 332) and untransform (dart 335) undo each other when f is invertible, mirroring the place-palindrome of transport/restore. Two ways a cell changes — its value, its place — each with a clean inverse on the far side of the nesting.