Ducks and monads: wonders of Ruby types
summary
Argues that Ruby needs explicit runtime types to avoid silent data corruption, cites a study of 1,000+ Rails apps where two of the top ten errors are nil-related (iterating a null, calling id on nil), and gives a concrete Rails JSON-upgrade bug as an example. Recommends using dry-types (and dry-struct) for strict constructors, using dry-monads result/either patterns with bind/value_or and do-notation to build pipelines, and removing ActiveSupport's blank and present which mask nilness.
AI-written summary · about
chapters (7)
- 0:00Start
- 5:47Silent data corruption: JSON in Rails
- 13:38Complex definitions
- 21:00Computations: bind
- 22:08Handling errors: or
- 22:51Non-monadic computations: fmap
- 23:33Escaping the context: value or








