Essential session storage is required to sign in. Optional analytics remain off unless you allow them.
Write a small Swift program (a command-line tool or a Swift Playground) that models a domain with idiomatic, safe Swift — no SwiftUI yet. It must: prefer let over var; model entities with STRUCTS (value types) and a memberwise init; use OPTIONALS correctly for values that may be absent (if let / guard let / ??, avoid force-unwrap); use an ENUM with associated values to model a result or state; and process a collection with map/filter/reduce. Use a `switch` (exhaustive) somewhere. Explain in a comment the difference between your structs (value types, copied) and where you would instead need a class (reference type).
Structs as value types with memberwise init; prefers let; correct optional handling (no reckless force-unwrap); exhaustive switch.
An enum with associated values models state/result; map/filter/reduce over a collection.
Correctly explains value (struct) vs reference (class) semantics and when each is right.
Use this README structure to make the work reviewable.
DevPath fetches a read-only, size-capped snapshot. Submitted code is never executed.
# A safe Swift value-type model ## Goal Write a small Swift program (a command-line tool or a Swift Playground) that models a domain with idiomatic, safe Swift — no SwiftUI yet. It must: prefer let over var; model entities with STRUCTS (value types) and a memberwise init; use OPTIONALS correctly for values that may be absent (if let / guard let / ??, avoid force-unwrap); use an ENUM with associated values to model a result or state; and process a collection with map/filter/reduce. Use a `switch` (exhaustive) somewhere. Explain in a comment the difference between your structs (value types, copied) and where you would instead need a class (reference type). ## Acceptance criteria - [ ] Value types & safety: Structs as value types with memberwise init; prefers let; correct optional handling (no reckless force-unwrap); exhaustive switch. - [ ] Enums & functional style: An enum with associated values models state/result; map/filter/reduce over a collection. - [ ] Understanding: Correctly explains value (struct) vs reference (class) semantics and when each is right. ## Verification - [ ] Document installation and run commands. - [ ] Record automated checks and their exact commands. - [ ] Add representative output, screenshots, or a short demo where useful. - [ ] Confirm failure paths and known constraints. ## Decision log ### Decision title - Context: - Choice: - Alternatives considered: - Tradeoffs: ## Evidence - Link each rubric criterion to the file, test, or artifact that demonstrates it. ## Known limitations - List what is intentionally out of scope and what should be improved next.