Principles for Modular, Functional, Approachable Libraries
summary
Cats and Algebra aim to lower barriers to functional Scala by rethinking encodings, benchmarks and docs; Cats ships ~nine months after start with 45 contributors, ~1,000 commits, 174 issues and 363 PRs. The library builds a stack‑safe laziness primitive called Eval (three modes: now/later/always) to preserve composable fold and trampolined execution. Design choices favor a modular, platform-independent core with JVM/JS-specific modules, heavy property tests, explicit laws, and a governance style that still needs formalizing.
AI-written summary · about
chapters (8)
- 0:00Start
- 10:52Summary: • A journey of almost 4 years. • Some practices adopted very early leg benchmarking
- 22:53What are they? 1. Perceptions of difficulty 2. Performance concerns 3. Stability concerns
- 24:37How to overcome them? 1. Tutorials and examples (which work!) 2. Documentation tests, benchmarks, and profiling 3. Stand firm on important principles 4. Compromise on incidental details 5. Accept responsibility for education 6. Provide high-quality libraries
- 27:21What are they? 1. Perception of diques 2. Imposter syndrome and delayed feelings of mastery 3. Powerful but confusing libraries
- 31:38How to overcome them? 1. Model good technical and social practices 2. Reach out and welcome newcomers 3. Acknowledge the limits of our own knowledge 4. Provide opportunities for new work 5. Accept responsibility for education and codes of conduct 6. Foster a stable, long-term, supportive community
- 48:051. Stack sale by default 2. Express partiality with values not exceptiona 3. Minimize allocations where possible 4. Property-based testing 5. Aim for 100% test coverage 6. Benchmarking and real world tests
- 50:351. Avoid ineffecient default implementation 2. Do benchmarking and profiling to measure behavior 3. Perform manual mechanical optimizations if possible 4. Design low-level abstractions with performance in mind 5. Make common syntax/usage efficient
related talks
45mFree Your Monads and the Rest Will Follow
31mLet's get Functional (en)
47mPrinciples of Clean Functional Programming
39mA few tips on modelling things in Scala
45mEffective Scala
56mPrinciples of Elegance
01h 00mIntro to FP in Scala: Exploring a Toolbox for Solving Problems - Part 2 of 6
56mBack to Basics: Functional Programming and Monads in C++
