Programmable commas describe composing steps so a monad controls sequencing and failure handling instead of manual separators, nested checks, or thrown errors. section 5.4
The pattern turns a student lookup flow into a safe pipeline: clean input, validate it, fetch a record, format fields, and append output while invalid or missing data is skipped.
The composition is built with these monadic steps:
- use chain for validation and lookup steps that return monads. section 5.4
Imperative form and monadic rewrite
A direct version uses nested null checks and throws for invalid input or missing students. The monadic rewrite replaces that control flow with a composed pipeline that returns Either.Right on success or an error message on failure.
