@@ -23,16 +23,11 @@ trait OutputApi extends ParsersApi with TypesApi with Printers:
2323 trait Printer [A ]:
2424 def print (
2525 a : A ,
26- out : java.io.PrintStream ,
27- info : OutputApi .StreamInfo
26+ out : java.io.PrintStream
2827 ): Unit
2928
3029object OutputApi :
3130
32- case class StreamInfo (
33- isatty : Boolean
34- )
35-
3631 enum Alignment :
3732 case Left
3833 case Right
@@ -216,44 +211,40 @@ trait Printers extends LowPrioPrinters:
216211 self : OutputApi =>
217212
218213 given Printer [Unit ] with
219- def print (a : Unit , out : java.io.PrintStream , info : OutputApi . StreamInfo ): Unit = ()
214+ def print (a : Unit , out : java.io.PrintStream ): Unit = ()
220215
221216 given Printer [Array [Byte ]] with
222- def print (a : Array [Byte ], out : java.io.PrintStream , info : OutputApi . StreamInfo ): Unit =
217+ def print (a : Array [Byte ], out : java.io.PrintStream ): Unit =
223218 out.write(a)
224219
225220 given Printer [geny.Writable ] with
226- def print (a : geny.Writable , out : java.io.PrintStream , info : OutputApi . StreamInfo ): Unit =
221+ def print (a : geny.Writable , out : java.io.PrintStream ): Unit =
227222 a.writeBytesTo(out)
228223
229224 given [A ](using p : Printer [A ]): Printer [geny.Generator [A ]] with
230- def print (value : geny.Generator [A ], out : java.io.PrintStream , info : OutputApi . StreamInfo ): Unit =
231- value.foreach(v => p.print(v, out, info ))
225+ def print (value : geny.Generator [A ], out : java.io.PrintStream ): Unit =
226+ value.foreach(v => p.print(v, out))
232227
233228 inline given productListPrinter [A <: Iterable [B ], B <: Product ](using m : ProductLabels [B ]): Printer [A ] with
234- def print (value : A , out : java.io.PrintStream , info : OutputApi . StreamInfo ): Unit =
229+ def print (value : A , out : java.io.PrintStream ): Unit =
235230 val rows = value.map(_.productIterator.toIterable)
236- if info.isatty then
237- out.println(OutputApi .tabulate(rows, header = m.labels.map(_.toUpperCase)))
238- else
239- out.println(OutputApi .tabulate(rows, header = Iterable .empty))
231+ out.println(OutputApi .tabulate(rows, header = m.labels.map(_.toUpperCase)))
240232
241233 given nonProductListPrinter [A <: Iterable [B ], B ](using elemPrinter : Printer [B ]): Printer [A ] with
242- def print (value : A , out : java.io.PrintStream , info : OutputApi . StreamInfo ): Unit =
243- for elem <- value do elemPrinter.print(elem, out, info )
234+ def print (value : A , out : java.io.PrintStream ): Unit =
235+ for elem <- value do elemPrinter.print(elem, out)
244236
245237 given [A ](using p : Printer [A ]): Printer [concurrent.Future [A ]] with
246- def print (value : concurrent.Future [A ], out : java.io.PrintStream , info : OutputApi . StreamInfo ): Unit =
238+ def print (value : concurrent.Future [A ], out : java.io.PrintStream ): Unit =
247239 p.print(
248240 concurrent.Await .result(value, concurrent.duration.Duration .Inf ),
249- out,
250- info
241+ out
251242 )
252243
253244trait LowPrioPrinters :
254245 self : OutputApi =>
255246
256247 // fallback to always print something
257248 given [A ]: Printer [A ] with
258- def print (a : A , out : java.io.PrintStream , info : OutputApi . StreamInfo ): Unit =
249+ def print (a : A , out : java.io.PrintStream ): Unit =
259250 out.println(a.toString)
0 commit comments