I Command You to be Free!
summary
Refactors a side‑effecting PHP/Ruby codebase into explicit command values, then interpreters and finally the Free monad; examples use Ruby, Haskell, PHP, Stripe API, SQL and QuickCheck properties; tests become simple value equality and in‑memory interpreters replace slow DB integration tests; an optimizer coalesces inserts into one bulk operation and claims nearly 100x speedups; business logic emits a list/stream of commands that get interpreted, composed and unit‑tested; code lives at https://github.com/parsonsmatt/command-pattern and the technique is already used at Seller Labs with no PHP concurrency.
AI-written summary · about
chapters (11)
- 0:00Start
- 1:25BETTER CODE?
- 2:38TEST DRIVEN DESIGN
- 9:30WRONG HASKELL
- 14:28THREE MAGIC STEPS
- 16:32OUTPUT EFFECTS
- 26:37PROPERTY TESTING
- 27:25COMMAND INTERPRETER
- 29:46TRAVERSABLE
- 29:57SIMPLE DATA
- 49:02THE SCARY 'M' WORD
related talks
57mFirst Class Commands: The 2017 Edition
41mCommand and (e)mission Control
41mThe Free Monad by Example
30mA Tale of Two Codepaths: Notes on a Refactor
52mGo Fully Functional and Take Your Legacy Code with You!
31mWhat Comes After MVC
46mThe path to declarative programming
33mEastward Ho! A Clear Path Through Ruby With OO Jim Gay
