sealed trait Printer[+Err, +Out, -Value] extends AnyRef
A Printer takes a value of type 'Value' and either produces a stream of 'Out' elements and a result value of type 'Result', or fails with a custom error of type 'Err'.
Parsers can be combined with Printers to get Syntax, or a Parser and a Printer can be built simultaneously by using the combinators of Syntax.
- Err
Custom error type
- Out
Element type of the output stream of printing
- Value
The type of the value to be printed
- Self Type
- Printer[Err, Out, Value]
- Alphabetic
- By Inheritance
- Printer
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def *: Printer[Err, Out, Chunk[Value]]
Symbolic alias for repeat0
- final def +: Printer[Err, Out, Chunk[Value]]
Symbolic alias for repeat
- final def <+>[Err2 >: Err, Out2 >: Out, Value2](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Either[Value, Value2]]
Symbolic alias for orElseEither
- final def <>[Err2 >: Err, Out2 >: Out, Value2 <: Value](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Value2]
Symbolic alias for orElse
- final def <~[Err2 >: Err, Out2 >: Out](that: => Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Value]
Symbolic alias for zipLeft
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ?: Printer[Err, Out, Option[Value]]
Symbolic alias for optional
- final def apply(value: Value): Printer[Err, Out, Any]
Provide this printer it's input value
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def asPrinted[Value2](matches: Value2, value: Value): Printer[Err, Out, Value2]
Ignores the printer's result and input and use 'result' and 'value' instead
- final def between[Err2 >: Err, Out2 >: Out](left: Printer[Err2, Out2, Unit], right: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Value]
Surround this printer with 'left' and 'right', each getting Unit as value to be printed.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def contramap[Value2](f: (Value2) => Value): Printer[Err, Out, Value2]
Maps the printer's input value with function 'f'
- final def contramapEither[Err2, Value2](from: (Value2) => Either[Err2, Value]): Printer[Err2, Out, Value2]
Maps the printer's result with function 'to' and its input value with 'from'.
Maps the printer's result with function 'to' and its input value with 'from'. Both functions can fail the printer.
- final def contramapTo[Err2 >: Err, Value2](from: PartialFunction[Value2, Value], failure: Err2): Printer[Err2, Out, Value2]
Maps the result of the printer with the function 'to', and the value to be printed with the partial function 'from'.
Maps the result of the printer with the function 'to', and the value to be printed with the partial function 'from'. It the partial function is not defined on the value, the printer fails with 'failure'.
This can be used to define separate syntaxes for subtypes, that can be later combined.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def filter[E2 >: Err, Value2 <: Value](condition: (Value2) => Boolean, failure: E2): Printer[E2, Out, Value2]
Specifies a filter condition 'condition' that gets checked on both the printed and the result value and in case it evaluates to false, fails with 'failure'.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def flatten(implicit ev1: <:<[Chunk[String], Value]): Printer[Err, Out, String]
Concatenates a chunk of string to be printed
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def mapError[Err2](f: (Err) => Err2): Printer[Err2, Out, Value]
Maps the error with function 'f'
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def optional: Printer[Err, Out, Option[Value]]
Print option values
- final def orElse[Err2 >: Err, Out2 >: Out, Value2 <: Value](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Value2]
Prints this and if it fails, ignore the printed output and print 'that' instead.
- final def orElseEither[Err2 >: Err, Out2 >: Out, Value2](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Either[Value, Value2]]
Prints this if the input is 'Left', or print 'that' if the input is 'Right'
- final def print(value: Value): Either[Err, Chunk[Out]]
Print the given 'value' to a chunk of output elements
- final def print[Out2 >: Out](value: Value, target: Target[Out2]): Either[Err, Unit]
Print the given 'value' to the given 'target' implementation
- final def printString(value: Value)(implicit ev: <:<[Out, Char]): Either[Err, String]
Print the given 'value' to a string
- final def repeat: Printer[Err, Out, Chunk[Value]]
Repeats this printer for each element of the input chunk, assuming it has at least one element
- final def repeat0: Printer[Err, Out, Chunk[Value]]
Repeats this printer for each element of the input chunk, zero or more times
- final def repeatUntil[Err2 >: Err, Out2 >: Out](stopCondition: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Chunk[Value]]
Repeat this printer for each element of the input chunk, verifying the 'stopConfition' after each.
- final def repeatWithSep[Err2 >: Err, Out2 >: Out](sep: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Chunk[Value]]
Repeats this printer for each element of the input chunk, separated by the 'sep' printer (which gets Unit to be printed)
- final def repeatWithSep0[Err2 >: Err, Out2 >: Out](sep: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Chunk[Value]]
Repeats this printer for each element of the input chunk that can be empty, separated by the 'sep' printer (which gets Unit to be printed)
- final def surroundedBy[Err2 >: Err, Out2 >: Out](other: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Value]
Surround this printer with 'other', which will get Unit as value to be printed.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def transformOption[Value2](from: (Value2) => Option[Value]): Printer[Option[Err], Out, Value2]
Maps the printer's result with function 'to' and its input value with 'from'.
Maps the printer's result with function 'to' and its input value with 'from'. Both functions can fail the printer. Failure is indicated by None on the error channel.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def widenWith[Err2 >: Err, Value2](narrow: PartialFunction[Value2, Value], failure: Err2): Printer[Err2, Out, Value2]
Widen this printer's printed value type by specifying a partial function to narrow it back to the set of supported subtypes.
- final def zipLeft[Err2 >: Err, Out2 >: Out](that: => Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Value]
Print 'that' by providing the unit value to it after printing this.
Print 'that' by providing the unit value to it after printing this. The result is this printer's result.
- final def |[Err2 >: Err, Out2 >: Out, Value2 <: Value](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Value2]
Symbolic alias for orElse