soma.cell

Programs using lambdas

40 verified Soma programs that use lambdas. Start from one of these when you write a program that needs it.

ProgramLinesUses
A horde: one [task] agent per document, a bounded pool, a hard token budget, each verdict stored exactly once, a summary at the end58an agent cell, LLM calls (think), pipes (|>), lambdas, require / fail, several cells
A population simulation in rounds: every agent of a round sees the same62an agent cell, LLM calls (think), pipes (|>), lambdas, several cells
A ReAct-style agent whose tools are real, deterministic computations63a state machine, an agent cell, LLM calls (think), pipes (|>), try / catch, lambdas, tools
A/B test rollup: per-variant conversions and lift over control60pipes (|>), lambdas
Cohort analysis: bucket users by signup month, then measure how many were still active in a later month59pipes (|>), lambdas
CSV-shaped transform: clean -> derive -> project51pipes (|>), lambdas
Expense report over a List<Map> of line items62pipes (|>), lambdas
group_by returns a Map<String, List>; iterate its entries to compute a custom reduction the built-in agg doesn't cover (here: weighted average)58pipes (|>), lambdas
left_join keeps every left row even when the right side has no match54pipes (|>), lambdas
Survey scoring: normalize raw responses, roll up per question, and flag low-confidence questions50pipes (|>), lambdas
Portfolio P&L tracker over a list of position records63pipes (|>), lambdas
Pig — the press-your-luck dice game, scored from a roll log66lambdas
Snake — one movement tick with growth, wall and self collision75lambdas
Tic-tac-toe win detection — pure board logic67lambdas
Yahtzee — score a roll of five dice in any category counts() buckets the five dice into face frequencies99lambdas
Inventory conservation — stock never teleports, never goes negative92a memory invariant, pipes (|>), try / catch, lambdas
Gcd / lcm — Euclid's algorithm and its consequences gcd() is a builtin (Euclid on absolute values)54pipes (|>), lambdas
Descriptive statistics — mean, variance, stddev, median via sort69pipes (|>), lambdas
Vector operations — dot product, norm, cosine similarity56pipes (|>), lambdas
Blood bank — an ABO-incompatible transfusion is unrepresentable, and129a memory invariant, match, try / catch, lambdas
Vaccine cold-chain — a temperature breach is PERMANENT, not "probably fine"126a state machine, a memory invariant, try / catch, lambdas
Infusion pump — the programmed rate can never exceed the drug's hard limit ("guardrails") A nurse programming an IV pump types the rate by hand113a memory invariant, try / catch, lambdas
Prescription interaction lockout — a lethal drug combination is refused142a memory invariant, try / catch, lambdas
Autoclave sterilization — a failed cycle can never release instruments159a state machine, a memory invariant, try / catch, lambdas
Entity-Component shape: each Entity record carries a bag of components60pipes (|>), lambdas
Employee directory: records driving group_by / agg / inner_join style reporting54pipes (|>), lambdas
Inventory: a list of Item records with in-place quantity mutation, restock/sell operations, and aggregate reporting via pipelines59pipes (|>), lambdas
Kanban board: Card records stored by id in a Map slot, moved between columns by mutating a field and writing back55pipes (|>), lambdas
Order records with nested line-items, computed totals, and a state machine over the order lifecycle58a state machine, a sum type, pipes (|>), lambdas
Playlist as an ordered list of Track records50pipes (|>), lambdas
Gradebook: Student records each holding a list of Score records58pipes (|>), match, lambdas
Acronym / initials — first letter of each word, uppercased43pipes (|>), lambdas
CSV split/join — parse rows and project columns54pipes (|>), lambdas
CSV to Markdown table — render rows as a pipe-delimited table49pipes (|>), lambdas
Reverse word order — "hello world" -> "world hello"46pipes (|>), lambdas
Title case — capitalize the first letter of every word40pipes (|>), lambdas
Tokenizer — split text into normalized word tokens45pipes (|>), lambdas
Mini blog API with tag filtering. Posts carry a list of tags;61HTTP routes, pipes (|>), match, lambdas
Voting / poll API: fixed options, one counter per option, results sorted63HTTP routes, pipes (|>), match, lambdas
Webhook receiver + event log. POST /hook/<source> appends an event;71HTTP routes, pipes (|>), match, lambdas