ilo 0.11.6

ilo — a programming language for AI agents
Documentation
-- flat xs:L (L a) > L a, flatten a list one level. Inner lists are
-- spliced into the result; non-list elements pass through unchanged.
-- Works identically on the tree-walking interpreter, the bytecode VM,
-- and the Cranelift JIT.

-- Basic nested flatten
basic>L n;flat [[1, 2], [3, 4]]

-- Empty outer list
empty>L n;flat []

-- Inner empty lists are dropped
gaps>L n;flat [[1], [], [2]]

-- Mixed: non-list items pass through
mixed>L n;flat [[1, 2], 3, [4, 5]]

-- Composes with sum so the result feeds a numeric reducer
total>n;sum (flat [[1, 2], [3, 4]])

-- run: basic
-- out: [1, 2, 3, 4]
-- run: empty
-- out: []
-- run: gaps
-- out: [1, 2]
-- run: mixed
-- out: [1, 2, 3, 4, 5]
-- run: total
-- out: 10