v0.18.0
0.18.0 - 2024-08-18
New Features
refined4s-chimney
Add missing type-classes for Chimney
-
[
refined4s-chimney
] Add missingTransformer
to unwrap value forChimneyNewtype
(#340)import refined4s.* import refined4s.modules.chimney.derivation.* final case class Person(name: Person.Name) object Person { type Name = Name.Type object Name extends Newtype[String], ChimneyNewtype[String] } final case class User(name: String) import io.scalaland.chimney.* import io.scalaland.chimney.dsl.* val person = Person(Person.Name("Wade Wilson")) val deadpool = person.transformInto[User] // This is currently not possible.
-
[
refined4s-chimney
] Add missingTransformer
to unwrap value forChimneyRefined
(#341)import refined4s.* import refined4s.modules.chimney.derivation.* final case class Person(name: Person.NotEmptyStr) object Person { type NotEmptyStr = NotEmptyStr.Type object NotEmptyStr extends Refined[String], ChimneyRefined[String] { inline def invalidReason(a: String): String = "non-empty String" inline def predicate(a: String): Boolean = a != "" } } final case class User(name: String) import io.scalaland.chimney.* import io.scalaland.chimney.dsl.* val person = Person(Person.NotEmptyStr("Wade Wilson")) val deadpool = person.transformInto[User] // This was not possible.
-
[
refined4s-chimney
] AddPartialTransformer
to transformRefined[A]
toNewtype[Refined[A]]
forChimneyRefined
(#342)import refined4s.* import refined4s.modules.chimney.derivation.* import io.scalaland.chimney.* import io.scalaland.chimney.dsl.* final case class XMen(name: XMen.NotEmptyStr) object XMen { type NotEmptyStr = NotEmptyStr.Type object NotEmptyStr extends Refined[String], ChimneyRefined[String] { inline def invalidReason(a: String): String = "non-empty String" inline def predicate(a: String): Boolean = a != "" } } import refined4s.types.all.* final case class MarvelCharacter(name: MarvelCharacter.Name) object MarvelCharacter { type Name = Name.Type object Name extends Newtype[NonEmptyString], ChimneyNewtype[NonEmptyString] } val logan = XMen(XMen.NotEmptyStr("James Howlett")) import refined4s.modules.chimney.derivation.types.all.* val wolverine = logan.transformIntoPartial[MarvelCharacter]
-
[
refined4s-chimney
] AddPartialTransformer
to transformNewtype[A]
toNewtype[Refined[A]]
forChimneyNewtype
(#346)import refined4s.* import refined4s.modules.chimney.derivation.* import io.scalaland.chimney.* import io.scalaland.chimney.dsl.* final case class XMen(name: XMen.Name) object XMen { type Name = Name.Type object Name extends Newtype[String], ChimneyNewtype[String] } import refined4s.types.all.* final case class MarvelCharacter(name: MarvelCharacter.Name) object MarvelCharacter { type Name = Name.Type object Name extends Newtype[NonEmptyString], ChimneyNewtype[NonEmptyString] } val logan = XMen(XMen.Name("James Howlett")) import refined4s.modules.chimney.derivation.types.all.* val wolverine = logan.transformIntoPartial[MarvelCharacter]