ilo 26.5.0

ilo - the token-minimal programming language AI agents write
Documentation
-- rsum / ravg / rmin n xs > L n — rolling-window reducers.
--
-- Output length = `len xs - n + 1` (empty when `n > len xs`).
-- O(n) amortised total — running-sum for rsum/ravg, monotonic-deque
-- for rmin. Don't reach for `map (i:n>n;sum (slc xs i (+ i n))) ...`:
-- that's O(n*w) and explodes for fat windows on long inputs.
--
-- Window size n must be >= 1; n=0 errors ILO-R009.

-- Rolling sum, window=3
sums>L n;rsum 3 [1, 2, 3, 4, 5]

-- Rolling mean (a.k.a. simple moving average), window=3
means>L n;ravg 3 [1, 2, 3, 4, 5]

-- Rolling minimum, window=3 — classic sliding-window min benchmark
mins>L n;rmin 3 [5, 1, 4, 1, 5, 9, 2, 6]

-- Window=1 is the identity for all three
identity>L n;rsum 1 [10, 20, 30]

-- Window larger than the input → empty output (Python/numpy convention)
empty>L n;rsum 5 [1, 2, 3]

-- run: sums
-- out: [6, 9, 12]
-- run: means
-- out: [2, 3, 4]
-- run: mins
-- out: [1, 1, 1, 1, 2, 2]
-- run: identity
-- out: [10, 20, 30]
-- run: empty
-- out: []