PeaBox Lab › PeaLang › Learn › Chapter 27 › Lesson 3

Part V — The Modern Experience Layer · Chapter 27 · Lesson 3 of 3

The modern builtin toolkit

The 1.0.0-experience release added more builtins than the language had before it. Nobody memorizes them; everybody learns the shape and discovers the rest with pea stdlib. This lesson maps the territory.

Iteration and shaping

Path and record operations

String and codec helpers

Pipes and application

let total = pipe(
  orders,
  function(o) { return filter(o, function(r) { return r.status == "paid" }) },
  function(o) { return sum_by(o, function(r) { return r.amount }) }
)

pipe threads a value through single-argument functions; apply(fn, args) invokes with a list of arguments. Use pipes for linear transforms; reach for plain code past three stages.

Numbers and correctness

clamp / format_number / floor / ceil / log / exp / pow / gcd / lcm / sign / is_even / is_odd / lerp / between cover the scalar case; parse_int / parse_float with explicit fallbacks replace ad-hoc coercion. The type predicates — is_null / is_list / is_dict / is_string / is_number / is_bool / is_empty — are the honest way to guard the boundary of anything external.

Version note. Everything on this list is additive over v0.63 — no v0.63 program changes behavior, but almost every hand-rolled loop in a v0.63 codebase can become a one-liner now.

Guided practice

Rule of thumb. Before writing a helper function, search pea stdlib. The most-missed builtin in review is always the one that already exists.

← Previous Next →