~/talk

Functional refactoring

Talkat JavaDay 2013 · on Saturday, 2013-10-19· [functional-programming]
links:none on file
slides:none on file

Refactors a messy MongoDB-backed update for a chess user into composable functions that push the collection dependency out and eliminate deep nesting, building a small container with apply/map/flatMap/pure and a tag system to prevent mixing collections. Prototype implements a Reader-style DB wrapper and an Option transformer, then swaps to Scalaz ReaderT and MongoDB collection tagging, producing linear for-comprehension code, externalized dependency injection via a resolver, and working code that cuts three nested levels to one.

AI-written summary · about

  1. 0:00Introduction to refactoring
  2. 3:08Problems with current code
  3. 7:12Dependency inversion approach
  4. 10:26Tagging collections for type safety
  5. 13:18Creating DB reader container
  6. 17:48Handling Option with transformer
  7. 21:04Dependency resolver implementation
  8. 24:59Program execution context
  9. 27:06Introducing Reader monad
  10. 30:18Final refactoring with Reader
  11. 33:07Summary and Q&A
~/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.