Data, and when not to use it
summary
Argues that many intermediate recursive data structures should be replaced by interfaces (Church encoding / final tagless) to avoid repeated allocations and traversals, demonstrating with Either error composition, an SVG-to-Android/iOS instruction program, and a RandomAccess example that inlines the free monad. Uses cats, inject type class, coproducts and monoid folds; reports large traversal costs and that free monads are noticeably slower while church-encoded folds are fast. Recommends concrete data only for cycles/graphs, primitive recursion, or heavy tree rewrites; testing can fix to free locally.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 0:48Background
- 10:55Lists
- 20:31Free Monads
- 21:30Sample Program
- 26:34Why do we like data
- 28:16The limitations of data
- 30:10The continuation passing style
- 33:34For comprehensions
- 36:40List folding
- 38:05Church encoded
- 38:47Method type
- 41:27Random access
- 42:59Church encoded interpreter
- 43:20Tradeoffs
- 51:18Junction
- 53:04More questions
related talks
01h 31mFrom C to Comonads to Climate: A Functional Programmer's Journey in Array Programming(…)
15mStatically Analyzing the Dataflow of R Programs
54mDesign Patterns vs Anti pattern in APL
26mDoing data science with Clojure: the ugly, the sad, the joyful
43mDoing Data Science with Clojure
53mCan Haskell Become a Great Language for Data Science?
29mGrammars of Data: lessons from ~20 years of the tidyverse
47mWhat Makes a Good Function
