~/talk

Monads: Exploring Railway Oriented Programming in Ruby

Talkat rubyday 2024 · on Friday, 2024-05-31· [ruby, testing]
slides:none on file

Live coding builds a small Ruby library that implements Railway Oriented Programming: an Outcome monad with Success/Failure types, bind and map for chaining single‑track functions, and an unwrap that raises once for controller error handling. Uses sbet for file typing, a pizza/lunch order example, and tests that end up all passing. Error types (invalid_param, forbidden) are added so failures carry standardized payloads. Code is on GitHub with branches main and use_outcome and the demo completes successfully.

AI-written summary · about

  1. 0:00Railway Oriented Programming intro
  2. 1:45What is Railway Oriented Programming
  3. 9:10Monad for error handling
  4. 19:25Encapsulation and chaining with monads
  5. 23:25Refining error types
  6. 29:59Single-track functions
  7. 32:29Unwrapping outcomes
  8. 34:36Benefits of Railway Oriented Programming
  9. 36:44Q&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.