Skip to content

v1.21.0

Latest

Choose a tag to compare

@kevin-lee kevin-lee released this 23 Aug 09:16
v1.21.0

1.21.0 - 2026-08-23

New Features

[refined4s-core] Add cats.Order type class instances for all pre-defined types (#617)

refined4s-core already provides cats.Eq, cats.Hash and cats.Show instances for the pre-defined types using the "no more orphans" technique from orphan-cats, so they are available without any import when cats is on the classpath while refined4s-core itself does not depend on cats. Now cats.Order is provided in the same way.

import cats.*
import cats.syntax.all.*
import refined4s.types.all.*

Order[PosInt].compare(PosInt(1), PosInt(2))
// Int = -1

PosInt(1) < PosInt(2)
// Boolean = true

NonEmptyString("b") comparison NonEmptyString("a")
// cats.kernel.Comparison = GreaterThan

NonEmptyString("b") max NonEmptyString("a")
// NonEmptyString = b

The Order instance is derived from the underlying type's cats.Order, and it is added to every pre-defined type in

  • refined4s.types.numeric
    • NegInt, NonNegInt, PosInt, NonPosInt
    • NegLong, NonNegLong, PosLong, NonPosLong
    • NegShort, NonNegShort, PosShort, NonPosShort
    • NegByte, NonNegByte, PosByte, NonPosByte
    • NegFloat, NonNegFloat, PosFloat, NonPosFloat
    • NegDouble, NonNegDouble, PosDouble, NonPosDouble
    • NegBigInt, NonNegBigInt, PosBigInt, NonPosBigInt
    • NegBigDecimal, NonNegBigDecimal, PosBigDecimal, NonPosBigDecimal
  • refined4s.types.strings
    • NonEmptyString, NonBlankString, Uuid
  • refined4s.types.network
    • Uri, Url
    • PortNumber, SystemPortNumber, NonSystemPortNumber, UserPortNumber, DynamicPortNumber
  • refined4s.types.time
    • Month, Day, Hour, Minute, Second, Millis

NOTE: UuidV7 has an Order instance as well, yet it remains temporarily hidden and unusable as it is not ready for production use.


Internal Housekeeping

Update effectie, extras and logback, and move test-only dependencies into libs.tests (#615)

  • effectie: 2.4.0 => 2.5.0
  • extras: 0.55.0 => 0.56.0
  • logback-classic: 1.5.6 => 1.5.13

effectie 2.5.0 replaces the effect-specific Ce2Resource and Ce3Resource with a single ReleasableResource driven by a UseResource type class, so the doobie CE2 and CE3 test helpers now use ReleasableResource and require a UseResource context bound.

All test-only dependencies are moved into the libs.tests object with % Test attached at the definition, so each module's libraryDependencies no longer repeats % Test for them.

Update scalafmt from 3.8.3 to 3.10.5 and reformat the code accordingly (#616)

  • scalafmt: 3.8.3 => 3.10.5

.scalafmt.conf is adjusted for the new option names and dialect handling, and the code is reformatted by the new version. There is no behaviour change as these are formatting-only updates.

Bump sbt to 1.12.14 (#614)


What's Changed

  • Bump sbt to 1.12.14 by @kevin-lee in #614
  • Update effectie, extras and logback, and move test-only dependencies into libs.tests by @kevin-lee in #615
  • Update scalafmt from 3.8.3 to 3.10.5 and reformat the code accordingly by @kevin-lee in #616
  • Close #617: Add cats.Order type class instances for all pre-defined types with orphan-cats by @kevin-lee in #618
  • Add a GitHub Actions job to generate release notes and update sbt-devoops to 3.8.0 by @kevin-lee in #619
  • refined4s v1.21.0 by @kevin-lee in #620

Full Changelog: v1.20.0...v1.21.0