Renderable

com.phasmidsoftware.lascala.Renderable
See theRenderable companion object
trait Renderable[A]

Type class to render an A in a human-legible manner (as an alternative to toString), with nested structures indented according to the Layout.

Instances for the common types are in the companion object; a case class, sealed trait or enum can write derives Renderable.

NOTE: implementations of render may invoke toString, but toString may NOT call render.

Type parameters

A

the type to be rendered

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def render(a: A, indent: Int)(using Layout): String

Method to render a.

Method to render a.

Value parameters

a

the value to be rendered

indent

the number of tabs (see Layout) by which any lines after the first are indented

Attributes

Returns

a String that, if it has embedded newlines, will follow each newline with (possibly empty) white space, which is then followed by some human-legible rendering of a.

Extensions

Extensions

extension (a: A)
def render(using Layout): String

Extension method to render a (starting with no indentation).

Extension method to render a (starting with no indentation).

NOTE: this cannot take an indent parameter, because it would then erase to the same signature as render(a, indent). For a starting indent, invoke render(a, indent) on the instance.

Attributes