Idiomatic Scala Your Options Do Not Match
summary
Claims that Option is best used as a collection/monad via map, flatMap, filter, fold and many built-in methods rather than pattern matching, demonstrates fold is more type-safe than naive pattern matches, and enumerates practical tools (map, getOrElse, fold, exists, forAll, count, toSeq/toList/toSet, toRight/toLeft, contains) with examples and tests. Shows a refactor where changing Option to Seq requires no method changes and thus saves work, uses small code samples and a test helper to prove behavior, and everything runs as advertised.
AI-written summary · about
chapters (4)
related talks
42mLovely for-comprehensions: Scala's most useful syntactic tool
49mScala best practices I wish someone'd told me about
52mScala Best Practices I Wish Someone'd Told Me About
39mA few tips on modelling things in Scala
48mTDD, Like in Type Driven Development
01h 00mIntro to FP in Scala: Exploring a Toolbox for Solving Problems - Part 2 of 6
54mRoll Your Own Shapeless
10mScalaF: Functional Refactoring Suggestions for Scala
