A Skeptic’s Look at scalaz’ Gateway Drugs: A Practical Exploration
summary
Practical notes on using scalaz in production: converts Option chains to \/ (disjunction) so failures carry messages instead of silent None, and replaces ad-hoc exceptions with fromTryCatchNonFatal returning disjunctions. Uses Validation[NonEmptyList[String], A] and applicative operators (star/pipe) to accumulate multiple error messages (example: DB user and address checks) and returns a non-empty list of errors to the frontend. Proven useful on real API servers and easier to debug than thrown 500s.
AI-written summary · about
chapters (9)
- 0:00Intro
- 1:24How I've Traditionally Seen scalaz
- 6:18Scala's Either: The Limitations
- 7:24Disjunctions as an Alternative
- 11:31Digression: Scala Option
- 17:04Validation looks similar to Vat first glance
- 20:53Sticking it all together
- 28:20One last function: Error Handling
- 31:32Final Thought On Naming
related talks
29mA Skeptic's Look at Scalaz Gateway Drugs
34mScalaz 102 Level Up Your Scalaz Foo!
01h 35mAn Unexceptional Scalaz Workshop
29mLearning Scalaz
51mScalaz Streams A Functional Approach to Compositional...
28mAutomating API Busywork with Scala
59mMinimizing the Slippery Surface of Failure
31mSCALATEST: YOU'RE ASSERTING IT WRONG
