~/talk

Index your State for Safer Functional APIs

links:none on file
slides:none on file

Claims that using IndexedState in Scala (via Scalaz/StateT) enforces API call order at compile time rather than relying on runtime checks. Demonstrates transforming a mutable-style connection/cache API into an immutable, indexed-state API that threads a cache through Future-based effects and rejects invalid call sequences (e.g., update before lock) by failing to compile. Shows types, flatMap mechanics, contravariance benefits, and a small transactional cache/lock/update/commit example that works under the indexed-state model.

AI-written summary · about

  1. 0:00Identifying API flaws
  2. 1:47Immutable API design
  3. 3:22Basics of the state monad
  4. 7:34State transformers
  5. 10:46Introduction to indexed state
  6. 13:34Enforcing state transitions
  7. 16:54Trade-offs and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.