The joy of Functional Programming in Dart
summary
Shows how Dart enforces purity and immutability with final/const and immutable records by refactoring an area-of-circle example that breaks when pi is mutable and when radius is negative. Demonstrates error handling by replacing thrown exceptions with sealed result types and pattern matching, then composes async calls using the fpdart Either/Task (TaskEither) types to avoid nested futures. Mentions immutability helpers (freezed, equatable) and gives a small GitHub playground for the examples.
AI-written summary · about
chapters (15)
- 0:00Introduction and thanks
- 1:07What is functional programming
- 3:12Purity and immutability in Dart
- 7:28Declarative vs imperative style
- 9:16Higher order functions in Dart
- 10:40Dart features for functional style
- 13:54Records and patterns in Dart
- 16:50Pattern matching benefits
- 17:53Handling errors with Result
- 21:05Chaining async operations
- 22:09Useful functional packages
- 23:33FP Dart package overview
- 25:18Task type for async chains
- 27:45Refactoring with TaskEither
- 28:05Conclusion and key takeaways
related talks
44mFunctional Programming You Already Know
06mBrian Lonsdorf (loop/recur) interviewed at Fluent 2014
01h 31mFunctional Programming in Modern C++: The Imperatives Must Go!
56mFunctional Programming with JavaScript
48mKotlin & Functional Programming: pick the best, skip the rest
01h 06mThe Joy of Functional Programming
49m“Applying functional programming in code design"
58mFunctional Programming with C#
