Refined, Tailor-Made Types
summary
Refined integrates validation rules into Scala types so invalid values are rejected at compile time or produce structured runtime errors via the from constructor. It shows using play-refined for JSON (de)serialization and error mapping in Play, and migrating a REST DTO layer to refined types so service code receives already-validated values. It reports production use works but reduces ergonomics (numeric operations need .value or implicits) and requires extra library imports to restore usual operations.
AI-written summary · about
chapters (6)
- 0:00Intro
- 1:00Why Refined?
- 3:28Refined: The Concept
- 6:56Compile-Time Validation
- 11:28String & Collection Predicates
- 19:16Conclusion
related talks
44mTelling the Truth with Types
33mArmored type safety with Iron
42mLet the Compiler Help You: How to Make the Most of Scala's Type System
49mThe Trouble With Types
01h 09mRefraction of Reality: Dynamic Validation with Static Types
33mPurifying Typescript
21mThe long-tail of type safety
48mA gentle introduction to type level programming in Scala
