Object/Class

org.typelevel.paiges

Doc

Related Docs: class Doc | package paiges

Permalink

object Doc extends Serializable

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Doc
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def cat(ds: Iterable[Doc]): Doc

    Permalink

    Concatenate the given documents together.

    Concatenate the given documents together.

    cat(ds) is equivalent to ds.foldLeft(empty)(_ + _)

  6. def char(c: Char): Doc

    Permalink

    Build a document from a single character.

  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val comma: Doc

    Permalink

    a literal comma, equivalent to char(',')

  9. def defer(d: ⇒ Doc): Doc

    Permalink

    Defer creation of a Doc until absolutely needed.

    Defer creation of a Doc until absolutely needed. This is useful in some recursive algorithms

  10. val empty: Doc

    Permalink
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def equivAtWidths(widths: List[Int]): Equiv[Doc]

    Permalink

    Require documents to be equivalent at all the given widths, as well as at their "wide" renderings.

  14. def fill(sep: Doc, ds: Iterable[Doc]): Doc

    Permalink

    Collapse a collection of documents into one document, delimited by a separator.

    Collapse a collection of documents into one document, delimited by a separator.

    For example:

    import Doc.{ comma, line, text, fill } val ds = text("1") :: text("2") :: text("3") :: Nil val doc = fill(comma + line, ds)

    doc.render(0) // produces "1,\n2,\n3" doc.render(6) // produces "1, 2,\n3" doc.render(10) // produces "1, 2, 3"

  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def foldDocs(ds: Iterable[Doc])(fn: (Doc, Doc) ⇒ Doc): Doc

    Permalink

    Combine documents, using the given associative function.

    Combine documents, using the given associative function.

    The function fn must be associative. That is, the expression fn(x, fn(y, z)) must be equivalent to fn(fn(x, y), z).

    In practice this method builds documents from the right, so that the resulting concatenations are all right-associated.

  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. def intercalate(sep: Doc, ds: Iterable[Doc]): Doc

    Permalink

    Concatenate the given documents together, delimited by the given separator.

    Concatenate the given documents together, delimited by the given separator.

    For example, intercalate(comma, List(a, b, c)) is equivalent to a + comma + b + comma + b.

  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. val line: Doc

    Permalink

    when flattened a line becomes a space You might also @see lineBreak if you want a line that is flattened into empty

  22. val lineBreak: Doc

    Permalink

    A lineBreak is a line that is flattened into an empty Doc.

    A lineBreak is a line that is flattened into an empty Doc. This is generally useful in code following tokens that parse without the need for whitespace termination (consider ";" "," "=>" etc..)

    when we call .grouped on lineBreak we get lineOrEmpty

  23. val lineOrEmpty: Doc

    Permalink

    lineOrEmpty renders as empty if we can fit the rest or inserts a newline.

    lineOrEmpty renders as empty if we can fit the rest or inserts a newline. Identical to lineBreak.grouped

  24. val lineOrSpace: Doc

    Permalink

    lineOrSpace renders a space if we can fit the rest or inserts a newline.

    lineOrSpace renders a space if we can fit the rest or inserts a newline. Identical to line.grouped

  25. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. def orderingAtWidth(w: Int): Ordering[Doc]

    Permalink

    Order documents by how they render at the given width.

  29. def paragraph(s: String): Doc

    Permalink

    Split the given text into words (separated by whitespace), and then join those words with a space or newline.

    Split the given text into words (separated by whitespace), and then join those words with a space or newline.

    This produces text which will wrap naturally at line boundaries, producing a block of text.

    paragraph is an alias for Doc.split(s), which uses its default arguments to split on whitespace and to rejoin the documents with Doc.lineOrSpace.

  30. val space: Doc

    Permalink
  31. def spaces(n: Int): Doc

    Permalink

    Produce a document of exactly n spaces.

    Produce a document of exactly n spaces.

    If n < 1, and empty document is returned.

  32. def split(str: String, pat: Regex = Doc.splitWhitespace, sep: Doc = Doc.lineOrSpace): Doc

    Permalink

    Convert a string to text, replacing instances of the given pattern with the corresponding separator.

    Convert a string to text, replacing instances of the given pattern with the corresponding separator.

    Like Doc.text, this method will also lift newlines into the Doc abstraction.

    The default pattern to use is """\s+""".r and the default separator to use is Doc.lineOrSpace.

  33. def spread(ds: Iterable[Doc]): Doc

    Permalink

    Concatenate the given documents together, delimited by spaces.

  34. def stack(ds: Iterable[Doc]): Doc

    Permalink

    Concatenate the given documents together, delimited by newlines.

  35. def str[T](t: T): Doc

    Permalink

    Convert an arbitrary value to a Doc, using toString.

    Convert an arbitrary value to a Doc, using toString.

    This method is equivalent to Doc.text(t.toString).

  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  37. def tabulate(fill: Char, rightSep: String, rows: Iterable[(String, Doc)]): Doc

    Permalink

    build a table with the strings left aligned and the Docs starting in the column after the longest string.

    build a table with the strings left aligned and the Docs starting in the column after the longest string. The Docs on the right are rendered aligned after the rightSep

    fill

    the character used to fill the columns to make the values aligned (i.e. ' ' or '.')

    rightSep

    a string append left to the left of the value. Intended for use with bullets on values

    rows

    a List of key, value pairs to put in a table.

  38. def tabulate(kv: List[(String, Doc)]): Doc

    Permalink

    A simple table which is the same as: tabulate("", ' ', "", kv)

    A simple table which is the same as: tabulate("", ' ', "", kv)

    or, no right separator and a space as the fill

  39. def text(str: String): Doc

    Permalink

    Convert a string to text.

    Convert a string to text.

    This method translates newlines into an appropriate document representation. The result may be much more complex than a single Text(_) node.

  40. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  41. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped