Unclaimed project
Are you a maintainer of iron? Claim this project to take control of your public changelog and roadmap.
This release introduces RefinedSubtype having the behavior of pre-3.0.2 RefinedType:
RefinedType for fully opaque new typesRefinedSubtype for new types that are subtypes of their inner type e.g PosInt <: IntRefinedSubtype also provides RefinedType.Mirror instance and benefits from all existing givens for RefinedType.
import io.github.iltotore.iron.*
import io.github.iltotore.iron.constraint.numeric.Positive
import io.github.iltotore.
import zio.json.*
type PosInt = PosInt.T
object PosInt extends RefinedSubtype[Int, Positive]
val x: PosInt = PosInt(5)
val y: Int = x
val z = "5".fromJson[PosInt]
The type of RefinedType.Mirror#ops now is Refined[A, C] (Refined is either a RefinedType or RefinedSubtype) instead of RefinedType[A, C]. They have the exact same methods so the chance any source breaks is minimal and the fix trivial.
Full Changelog: https://github.com/Iltotore/iron/compare/v3.1.0...v3.2.0