Delimited dependently
summary
Scala code uses an imported mode to turn ordinary APIs into checked-exception APIs with almost no call-site syntax, implemented with implicits and type-level tricks from Rapture and TMaps. Methods return a Result that encodes distinct exception types (DataGetException, ReadException, ParseException, ValidationException) and composes them across flatMap by treating intersection types as intersection-as-union, letting for-comprehensions accumulate errors for validation-style aggregation. Demo shows JSON extraction collecting multiple missing-field errors and a quick rapture-i18n demo using Google Translate for missing locales.
AI-written summary · about
chapters (10)
- 0:00Start
- 5:36Modes: Returning Option
- 6:06Modes: Returning Try
- 6:19Modes: Returning Future
- 6:49Modes: Returning Either
- 8:09Why use modes?
- 9:39Reminder: Exceptions in Java
- 13:14Scoping
- 16:40Return: A tri-state return type
- 18:11Accumulating example
related talks
46mOptimusPrimeT
59mMinimizing the Slippery Surface of Failure
28mAutomating API Busywork with Scala
31mReal-Life Scala Capture Checking
20mType Classes for the Rest of Us
49mScala best practices I wish someone'd told me about
46mImplicits Inspected and Explained
37mA Skeptic’s Look at scalaz’ Gateway Drugs: A Practical Exploration
