soma.cell

Programs using match

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

ProgramLinesUses
Sentiment-routing agent: classify a message, route by polarity67a state machine, an agent cell, LLM calls (think), match, tools
Reflective tool-dispatch agent: routes a named action to the right tool77a state machine, an agent cell, LLM calls (think), match, try / catch, tools
Agent lifecycle typed against a sum type — typos become compile errors57a state machine, an agent cell, a sum type, match
A stack (LIFO) backed by a List, used to check balanced brackets69match
Relational inner_join: enrich order rows with customer details, then roll up spend per customer tier57pipes (|>), match
Meter billing — you are billed exactly what the meter read, once115a state machine, a memory invariant, match, try / catch
Brokerage fee calculator: tiered commission, bps fee with a floor, and a maker/taker exchange fee57match
Trade settlement as a sum type58a sum type, match
Blackjack — hand scoring with soft/hard aces and bust detection hand_value() sums card ranks, counting each Ace as 11 then demoting to 1 while the total busts86match
Craps — the come-out roll and point-resolution rules come_out(total) resolves the first roll: 7/11 wins, 2/3/12 craps out, any other number becomes the "point"77match
Number guessing game — hi/lo feedback and a binary-search solver feedback() compares a guess to the secret and returns "low" / "high" / "correct"67match
Mastermind — score a guess with black and white pegs92match
Rock-paper-scissors — round judging and best-of-N scoring judge(a, b) returns "p1", "p2", or "tie" from the two throws72match
Tournament bracket — eliminated means eliminated73a state machine, match, try / catch
Wager duel — staked gold that exactly one fighter can win122a state machine, a memory invariant, match, try / catch
Container seal — a broken seal cannot be quietly replaced108a state machine, a memory invariant, match, try / catch
Blood bank — an ABO-incompatible transfusion is unrepresentable, and129a memory invariant, match, try / catch, lambdas
Medication administration — the "five rights" enforced by barcode, no scan no dose Wrong-patient and wrong-drug medication errors are among the most common causes of inpatient harm135a state machine, match, try / catch
Surgical safety checklist — no incision before time-out, and the count146a state machine, a memory invariant, match, try / catch
Nested config record with defaults, merge-style overrides, and a deep-path reader58match
Gradebook: Student records each holding a list of Score records58pipes (|>), match, lambdas
Payments approval — a whole service in one file: a ledger that cannot overdraw, a payment lifecycle the verifier proves, an HTTP API that maps error kinds to status codes, and tests that run offline165a state machine, a memory invariant, HTTP routes, match, try / catch, require / fail, several cells, a whole verified service
Refund agent — an LLM decides, the language decides what it may do162a state machine, a memory invariant, an agent cell, a sum type, LLM calls (think), match, try / catch, guard blocks, require / fail, a cost bound, tools
Warehouse reservations — two cells: a stock ledger with hard bounds and a reservation lifecycle with a supervisor guard, behind one HTTP router187a state machine, a memory invariant, HTTP routes, match, try / catch, guard blocks, require / fail, several cells, a whole verified service
Turnstile — a signal that may take any edge, and says so84a state machine, a memory invariant, match, require / fail, a skeleton
Online game-match lifecycle81a state machine, a memory invariant, match
A two-road traffic-light interlock proven safe by construction62a state machine, match
Mini blog API with tag filtering. Posts carry a list of tags;61HTTP routes, pipes (|>), match, lambdas
Form handler with server-side validation54HTTP routes, match
Counter API: a persistent integer counter exposed over HTTP68HTTP routes, match
Feature-flag service: toggle named flags on/off, query state, list all61HTTP routes, match
Guestbook: append-only signed entries, rendered as a small HTML page66HTTP routes, match
Key-value store API with namespaced keys and a bulk export endpoint65HTTP routes, match
Leaderboard API: submit a score, get the ranked top-N86HTTP routes, pipes (|>), match
Metrics / health endpoint. Every request bumps a request counter;63HTTP routes, match
CRUD JSON API over a persistent Map: notes with title + body77HTTP routes, match
Paginated product list: GET /products?page=N&size=M slices a stored list57HTTP routes, match
Voting / poll API: fixed options, one counter per option, results sorted63HTTP routes, pipes (|>), match, lambdas
Session/login toy: POST /login issues a token, GET /me/<token> returns the user, POST /logout invalidates it58HTTP routes, match
Multi-page static site: home, about, and a dynamic greeting route42HTTP routes, match
Todo service backed by a typed state machine (sum type TodoStatus)82a state machine, a sum type, HTTP routes, match
URL shortener: POST a long URL, get a short code; GET the code redirects75HTTP routes, match
Webhook receiver + event log. POST /hook/<source> appends an event;71HTTP routes, pipes (|>), match, lambdas