~/talk

The Functional Fix: Kotlin Error Handling Made Elegant

Talkat Functional Conf 2025 · 2025-01-24..01-25· [kotlin]
slides:none on file

Refactors a procedural Kotlin HTTP-request matcher used in Specmatic into a Railway Oriented composition that returns an Either monad and chains via flatMap/fold; implements a small plumbing API — pipe/then/handleError — then replaces it with native Arrow KT flatMap composition. Example composes matchUrl → matchMethod → matchBody to pass the request along on success or short‑circuit with an error; takes about a week to prototype and is reused, but adds overhead so it pays off mainly for long chains (≈10 functions), not tiny ones.

AI-written summary · about

  1. 0:00Introduction
  2. 1:33The problem statement
  3. 5:30Railway oriented programming
  4. 10:06Code transformation journey
  5. 25:03Understanding monads
  6. 29:53Applying flatMap and fold
  7. 36:25Refining the final solution
  8. 39:09Q&A 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.