~/talk

Spotting Pure Functions in I/O Driven Code

Talkat JDD 2024 · 2024-10-22..10-23· [functional-programming]
links:none on file
slides:none on file

Claim: separating pure logic from IO makes code testable, refactorable and removes subtle bugs. Refactor of a food-ordering service in Scala pulls current time out as an explicit argument, finds a pure hours.encloses function, caches dayOfWeek to avoid rare clock-rollover bugs, and moves DB calls into an IO wrapper with run, map and flatMap used via for-comprehensions. Result: pure validators become trivially table-tested and facades return composable effect descriptions while actual IO runs only at the endpoint.

AI-written summary · about

  1. 0:00Welcome and introduction
  2. 1:55From OOP to functional programming
  3. 7:37Pure functions vs IO
  4. 12:38Refactoring spaghetti code
  5. 18:01Composing pure functions
  6. 22:17Separating IO and logic
  7. 24:50Introducing IO wrapper
  8. 33:37Summary and conclusions
  9. 38:19Q&A and closing
~/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.