~/talk

Unexpected Monad. Is Safe Error Handling Possible in JS/TS?

Talkat JSConf Budapest 2024 · 2024-06-26..06-28· [javascript]
slides:none on file

Claim: JavaScript/TypeScript can enforce typed exception flow by replacing try/catch with an Either/Result monad plus small glue to interoperate with promises and RxJS. Implementation uses TypeScript signatures, strict mode, custom Rx operators (mapEither, tapEither) and container types; a closed‑source Angular 8 app runs this in production since 2019. Outcome: compilation errors surface unhandled exception variants and handlers carry concrete types, reducing certain classes of bugs; tradeoffs are boilerplate, third‑party integration and custom lint rules.

AI-written summary · about

  1. 0:00Unexpected Monad intro
  2. 2:12Error handling checklist
  3. 5:47Try-catch improvements
  4. 10:49Multiple return values
  5. 13:40Container-based errors
  6. 17:42Monads as utilities
  7. 20:59Monads in Angular
  8. 24:42Why try-catch dominates
  9. 26:52Monads without PhD
  10. 27:37Q&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.