Unions and State
Model states and results as unions and narrow them safely: remote data, typed actions, optional values, validation and state machines.
- 01
Describe Each State of Remote Data
- easy
- Code
- 02
Assert a Value Is a Non-empty String
- easy
- Code
- 03
Filter Logs by a Typed Level
- easy
- Code
- 04
Describe Errors by Their Class
- easy
- Code
- 05
Parse Keyboard Shortcuts into Typed Keys
- easy
- Code
- 06
Reduce Todo Actions from a Typed Union
- medium
- Code
- 07
Model an Optional Value with Some and None
- medium
- Code
- 08
Parse JSON Safely into a Checked Shape
- medium
- Code
- 09
Tell Cats from Dogs by Their Properties
- medium
- Code
- 10
Charge a Fee per Payment Method
- medium
- Code
- 11
Summarise an Event Log by Kind
- medium
- Code
- 12
Route Requests Through a Handler per Method
- medium
- Code
- Pro
- 13
Type a Traffic Light State Machine
- hard
- Code
- Pro
- 14
Chain Validation Steps, Keeping Every Error Type
- hard
- Code
- Pro
- 15
Read Typed Values from Form Fields
- hard
- Code
- Pro