Programs using a sum type
9 verified Soma programs that use a sum type. Start from one of these when you write a program that needs it.
| Program | Lines | Uses |
|---|---|---|
| Agent lifecycle typed against a sum type — typos become compile errors | 57 | a state machine, an agent cell, a sum type, match |
| Trade settlement as a sum type | 58 | a sum type, match |
| Order records with nested line-items, computed totals, and a state machine over the order lifecycle | 58 | a state machine, a sum type, pipes (|>), lambdas |
| Refund agent — an LLM decides, the language decides what it may do | 162 | a 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 |
| Document editorial workflow with a typed (sum-type) state machine | 59 | a state machine, a sum type |
| A media-player transport state machine | 57 | a state machine, a sum type |
| Order lifecycle as a typed state machine | 58 | a state machine, a sum type |
| A simplified TCP connection state machine (active-open path) | 58 | a state machine, a sum type |
| Todo service backed by a typed state machine (sum type TodoStatus) | 82 | a state machine, a sum type, HTTP routes, match |