Functional Rust: From ADTs to Advanced Concurrency
summary
Refactors a brittle payment pipeline into a state-typed system where amount becomes an integer, payment states are encoded as enums and type parameters, and only allowed transitions compile, eliminating many runtime errors. Shows concrete use of Option/Result map for parsing and discounts, implements an applicative combine to merge independent Result parsers, uses and_then / ? (monadic chaining) to sequence steps, employs Mutex + Arc for per-payment parallelism and recommends Tokio for async scheduling.
AI-written summary · about
chapters (12)
- 0:00Functional Rust intro
- 4:14Flawed payment system
- 7:29Refactoring with state
- 12:27Functors for process line
- 17:47Combining computations
- 23:03Monadic chaining
- 27:54Domain vs implementation
- 28:14Rust generics overview
- 31:10Payment table views
- 33:02Batch authorization
- 33:47Rust concurrency & async
- 35:50Summary
related talks
41mFunctional Rust - An Exploration
35mFunctional Reactive Rust
26mThe Freedom of Static Typing
58mRust for The Curious C++ Developers
40mRust’s approach of getting things right
36mHow Functional Programming Can Make Life Easier
01h 06mThe Functional Programmer's Toolkit
48mKotlin & Functional Programming: pick the best, skip the rest
