micro-optimization to convert known coproducts to named types such as Option or Either.
micro-optimization to convert known coproducts to named types such as Option or Either.
Without this optimization, printing a product containing fields whose type is a coproduct would end up with something like:
case class Product(field1: Cop[Int :: String :: TNil], field2: Cop[Int :: Null :: TNil])
With it, we rename the known coproducts to the correspondent named types:
case class Product(field1: Either[Int, String], field2: Option[Int])
micro-optimization to convert types from fields in a product to NamedTypes.
micro-optimization to convert types from fields in a product to NamedTypes.
Without this optimization, printing a product containing fields of other products would end up with something like:
case class bbProduct(field1: String, field2: case class OtherField())
With it, we cut recursion in messages, to leave only type names:
case class Product(field1: String, field2: OtherField)
Optimize object contains transformations in same schema