Utiliy constructor defining a printer for some types.
Utiliy constructor defining a printer for some types.
Example use case is overriding the string repr for types which default pretty-printers do not output helpful diffs.
type ByteArray = Array[Byte] val listPrinter = Printer.apply { case ll: ByteArray => ll.map(String.format("%02x", b)).mkString(" ") } val bytes = Array[Byte](1, 5, 8, 24) Printers.print(bytes, listPrinter) // "01 05 08 18"