Pretty

scalus.utils.Pretty
See thePretty companion trait

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Pretty.type

Members list

Type members

Classlikes

object given_Pretty_BigInt extends Pretty[BigInt]

Attributes

Supertypes
trait Pretty[BigInt]
class Object
trait Matchable
class Any
Self type
object given_Pretty_Boolean extends Pretty[Boolean]

Attributes

Supertypes
trait Pretty[Boolean]
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object given_Pretty_Int extends Pretty[Int]

Attributes

Supertypes
trait Pretty[Int]
class Object
trait Matchable
class Any
Self type
object given_Pretty_Long extends Pretty[Long]

Attributes

Supertypes
trait Pretty[Long]
class Object
trait Matchable
class Any
Self type
object given_Pretty_String extends Pretty[String]

Attributes

Supertypes
trait Pretty[String]
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def apply[A](using p: Pretty[A]): Pretty[A]

Summon a Pretty instance

Summon a Pretty instance

Attributes

def braceList(entries: List[Doc]): Doc

Comma-separated list in braces: { a, b, c } or multiline with indent if needed

Comma-separated list in braces: { a, b, c } or multiline with indent if needed

Attributes

def bulletList(label: String, items: List[Doc]): Doc

Bullet list field with label

Bullet list field with label

Attributes

def ctr(s: String, style: Style): Doc

Constructor/type name styling (blue)

Constructor/type name styling (blue)

Attributes

def err(d: Doc, style: Style): Doc

Error styling (red)

Error styling (red)

Attributes

def field(label: String, value: Doc, style: Style): Doc

Field with label: "name: value"

Field with label: "name: value"

Attributes

def formatAda(lovelace: Long): String

Format lovelace as ADA with 6 decimal places

Format lovelace as ADA with 6 decimal places

Attributes

def formatHex(bytes: Array[Byte]): String

Format bytes as hex string

Format bytes as hex string

Attributes

def inBraces(d: Doc): Doc

Wrap in braces

Wrap in braces

Attributes

def inBrackets(d: Doc): Doc

Wrap in brackets

Wrap in brackets

Attributes

def inParens(d: Doc): Doc

Wrap in parentheses

Wrap in parentheses

Attributes

def instance[A](f: (A, Style) => Doc): Pretty[A]

Create a Pretty instance from a function

Create a Pretty instance from a function

Attributes

def instanceWithDetailed[A](concise: (A, Style) => Doc, detailed: (A, Style) => Doc): Pretty[A]

Create a Pretty instance with both concise and detailed implementations

Create a Pretty instance with both concise and detailed implementations

Attributes

def kw(s: String, style: Style): Doc

Keyword styling (orange/yellow)

Keyword styling (orange/yellow)

Attributes

def lit(d: Doc, style: Style): Doc

Value/literal styling (green)

Value/literal styling (green)

Attributes

def optField[A](label: String, opt: Option[A], style: Style)(using p: Pretty[A]): Doc

Optional field - returns empty Doc if None

Optional field - returns empty Doc if None

Attributes

def rainbowBracket(d: Doc, open: Char, close: Char, depth: Int, style: Style): Doc

Wrap content in rainbow-colored brackets based on nesting depth

Wrap content in rainbow-colored brackets based on nesting depth

Attributes

def rainbowChar(c: Char, depth: Int, style: Style): Doc

Create a bracket Doc with rainbow coloring based on depth

Create a bracket Doc with rainbow coloring based on depth

Attributes

def typ(d: Doc, style: Style): Doc

Type styling (purple)

Type styling (purple)

Attributes

Inherited methods

inline def derivePrettyProduct[A](using p: ProductOf[A]): Pretty[A]

Create a Pretty instance for a product type

Create a Pretty instance for a product type

Attributes

Inherited from:
LowPriorityPrettyInstances
inline def derivePrettySum[A](using s: SumOf[A]): Pretty[A]

Create a Pretty instance for a sum type

Create a Pretty instance for a sum type

Attributes

Inherited from:
LowPriorityPrettyInstances
inline def getElemLabels[Labels <: Tuple]: List[String]

Extract element labels from the MirroredElemLabels tuple type

Extract element labels from the MirroredElemLabels tuple type

Attributes

Inherited from:
LowPriorityPrettyInstances
inline def summonPrettyInstances[Types <: Tuple]: List[Pretty[Any]]

Summon Pretty instances for all element types in a tuple

Summon Pretty instances for all element types in a tuple

Attributes

Inherited from:
LowPriorityPrettyInstances

Givens

Givens

given given_Pretty_A_B[A, B](using a: Pretty[A], b: Pretty[B]): given_Pretty_A_B[A, B]
given given_Pretty_M[K, V, M <: (Map)](using pk: Pretty[K], pv: Pretty[V]): given_Pretty_M[K, V, M]

Pretty instance for Map (works with any scala.collection.Map)

Pretty instance for Map (works with any scala.collection.Map)

Attributes

given given_Pretty_Option[A](using p: Pretty[A]): given_Pretty_Option[A]

Pretty instance for Option - shows the value or empty

Pretty instance for Option - shows the value or empty

Attributes

given given_Pretty_Seq[A](using p: Pretty[A]): given_Pretty_Seq[A]

Pretty instance for Seq

Pretty instance for Seq

Attributes

Inherited givens

inline given derived[A](using m: Of[A]): Pretty[A]

Main derivation entry point - lower priority than explicit instances

Main derivation entry point - lower priority than explicit instances

Attributes

Inherited from:
LowPriorityPrettyInstances

Extensions

Extensions

extension (d: Doc)
def styled(s: Style, style: Style): Doc

Apply XTerm color styling if in XTerm mode

Apply XTerm color styling if in XTerm mode

Attributes