Why it matters

iron is modern Scala 3 refinements. Understanding shapes type-safe Scala 3.

Advertisement

The architecture

Type: 'Int :| Positive'.

Native Scala 3 union types.

iron in Scala 3Int :| Positivevalue + constraintCompile-timefor literalsRuntime validationfor user inputBetter error messages than refined; uses Scala 3 opaque types
iron usage.
Advertisement

How it works end to end

Constraints: Positive, NonEmpty, various.

Compile-time check for literals.

Runtime: eitherRefine[C].

Circe + Doobie integrations.