Phase 03TypeScript as a design tool164 of 434
Types as a record of intent
Take a module with correct but characterless types and rewrite them so that the constraints you have been keeping in your head are enforced by the compiler.
Build45 minAI implements
Build this in your own editor
This one runs on your machine rather than in the browser workbench. Work to the outcomes below, then come back and mark it complete.
You should now be able to
- Encode a business rule in a type rather than a comment
- Use branded types to stop two strings being interchangeable
Loading…