Decorate your types with refined
summary
Library refined adds precise constraints to existing Scala types and demonstrates both compile-time macro validation for literals and applyRef runtime Either for dynamic values, abstracting smart constructors so literals validate at compile time while nonliterals validate at runtime. Predicates include ranges, character classes, regex and compositors with subtyping inference; it uses shapeless witness and plans SIP-23 singleton syntax. Integrations exist for circe, Monocle, scodec and provides Arbitrary instances; code on GitHub and slides are linked.
AI-written summary · about
chapters (17)
- 0:00Start
- 1:16What's the problem with String?
- 2:15Add meaning and safety with value dasses
- 3:06Add validation logic smart constructors
- 6:10Refinement types
- 6:47Refinement subtyping
- 8:09Literals at the type-level
- 9:56GitHash with refined
- 11:49Refining values at compile-time
- 12:47Refining values at runtime
- 13:44How does that work?
- 17:44Logical predicates
- 18:11Collection predicates
- 18:34Numeric predicates
- 19:09String predicates
- 19:46Integration with other libraries
- 21:30Summary








