Control flow#
Use if for a Boolean decision, match for the cases of an alternative, and loops for repeated work. Leaving a block also runs any cleanup registered in that block.
| Concept | What you will learn |
|---|---|
| Conditionals | Branch on Bool values with if and else. |
| Loops | Iterate with for and while, and use break and continue. |
| Pattern matching | Handle alternatives exhaustively and bind their payloads. |