Why it matters
Refined types add invariants to types. Understanding shapes type-safe Scala.
Advertisement
The architecture
Type: 'Int Refined Positive'.
Predicate part of type.
Advertisement
How it works end to end
Predicates: Positive, NonEmpty, MatchesRegex, etc.
Compile-time: refineMV for literals.
Runtime: refineV[Pred](value) returns Either.
Scala 3 alternative: iron.