Closed KyleErwin closed 4 years ago
New functionality to improve the output of examples. An object, PrettyPrinter has been added to the io package that contains implicit instances of EncodeDoc for common types used throughout the example package. Where EncodeDoc is the following
PrettyPrinter
io
EncodeDoc
example
sealed trait EncodeDoc[A] { def toDoc(x: A): Doc }
And Doc is a type from typelevel/paiges that allows text to be rendered with a given width size.
Doc
Examples that make use of PrettyPrinter are
If the design and implementation of the PrettyPrinter is correct PrettyPrinter functionality can be added to all examples where applicable.
There is also a public method within PrettyPrinter for creating new instances of EncodeDoc if users which to use their own types.
Example output below
New functionality to improve the output of examples. An object,
PrettyPrinter
has been added to theio
package that contains implicit instances ofEncodeDoc
for common types used throughout theexample
package. WhereEncodeDoc
is the followingAnd
Doc
is a type from typelevel/paiges that allows text to be rendered with a given width size.Examples that make use of
PrettyPrinter
areIf the design and implementation of the
PrettyPrinter
is correctPrettyPrinter
functionality can be added to all examples where applicable.There is also a public method within
PrettyPrinter
for creating new instances ofEncodeDoc
if users which to use their own types.Example output below