Functional GUI Apps
summary
A small drawing app implemented in F# that models shapes as immutable records and performs all CRUD by returning rewritten document graphs rather than mutating objects. Updates go through one document controller that keeps a single mutable pointer and a history of snapshots so undo/redo is just moving a head through that history like built in git style versioning. Elements are referenced by IDs not pointers so background save and open are atomic and long running transforms become transactional background updates reducing event-driven memory leaks.
AI-written summary · about
chapters (24)
- 0:00Intro
- 1:28Simple Domain
- 2:11Moar Features!
- 2:31Common Properties
- 2:52Document Model
- 3:18CRUD Operations
- 3:51New Document
- 7:22Remove Elements
- 8:03Map the Document
- 9:25Change the Color
- 12:35Answer
- 13:48OOP Name Editor
- 15:14Functional Name Editor
- 16:48DocumentController
- 18:01Five Reasons
- 18:18Document-based App Requirements
- 19:20OOP Undo Architecture
- 19:40OOP Undo view. TextChanged += (s, e) = model. Name = view. Text
- 20:14For every command you write, you have to write its inverse
- 22:20Atomic Save
- 22:57Background Open
- 23:21Background Updates
- 24:18No Dangling References
- 25:34For This...
