ContramapEither

zio.parser.Printer.ContramapEither
final case class ContramapEither[Err, Err2, Out, Value2, Value](printer: Printer[Err, Out, Value], from: Value2 => Either[Err2, Value]) extends Printer[Err2, Out, Value2]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Printer[Err2, Out, Value2]
trait VersionSpecificPrinter[Err2, Out, Value2]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

final def *: Printer[Err2, Out, Chunk[Value2]]

Symbolic alias for repeat0

Symbolic alias for repeat0

Attributes

Inherited from:
Printer
final def +: Printer[Err2, Out, Chunk[Value2]]

Symbolic alias for repeat

Symbolic alias for repeat

Attributes

Inherited from:
Printer
final def <+>[Err2 >: Err2, Out2 >: Out, Value2](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Either[Value2, Value2]]

Symbolic alias for orElseEither

Symbolic alias for orElseEither

Attributes

Inherited from:
Printer
final def <>[Err2 >: Err2, Out2 >: Out, Value2 <: Value2](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Value2]

Symbolic alias for orElse

Symbolic alias for orElse

Attributes

Inherited from:
Printer
final def <~[Err2 >: Err2, Out2 >: Out](that: => Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Value2]

Symbolic alias for zipLeft

Symbolic alias for zipLeft

Attributes

Inherited from:
Printer
final def ?: Printer[Err2, Out, Option[Value2]]

Symbolic alias for optional

Symbolic alias for optional

Attributes

Inherited from:
Printer
final def apply(value: Value2): Printer[Err2, Out, Any]

Provide this printer it's input value

Provide this printer it's input value

Attributes

Inherited from:
Printer
final def asPrinted[Value2](matches: Value2, value: Value2): Printer[Err2, Out, Value2]

Ignores the printer's result and input and use 'result' and 'value' instead

Ignores the printer's result and input and use 'result' and 'value' instead

Attributes

Inherited from:
Printer
final def between[Err2 >: Err2, Out2 >: Out](left: Printer[Err2, Out2, Unit], right: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Value2]

Surround this printer with 'left' and 'right', each getting Unit as value to be printed.

Surround this printer with 'left' and 'right', each getting Unit as value to be printed.

Attributes

Inherited from:
Printer
final def contramap[Value2](f: Value2 => Value2): Printer[Err2, Out, Value2]

Maps the printer's input value with function 'f'

Maps the printer's input value with function 'f'

Attributes

Inherited from:
Printer
final def contramapEither[Err2, Value2](from: Value2 => Either[Err2, Value2]): Printer[Err2, Out, Value2]

Maps the printer's result with function 'to' and its input value with 'from'. Both functions can fail the printer.

Maps the printer's result with function 'to' and its input value with 'from'. Both functions can fail the printer.

Attributes

Inherited from:
Printer
final def contramapTo[Err2 >: Err2, Value2](from: PartialFunction[Value2, Value2], 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'. It the partial function is not defined on the value, the printer fails with 'failure'.

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.

Attributes

Inherited from:
Printer
final def filter[E2 >: Err2, Value2 <: Value2](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'.

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'.

Attributes

Inherited from:
Printer
final def flatten(implicit ev1: Chunk[String] <:< Value2): Printer[Err2, Out, String]

Concatenates a chunk of string to be printed

Concatenates a chunk of string to be printed

Attributes

Inherited from:
Printer
final def mapError[Err2](f: Err2 => Err2): Printer[Err2, Out, Value2]

Maps the error with function 'f'

Maps the error with function 'f'

Attributes

Inherited from:
Printer
final def optional: Printer[Err2, Out, Option[Value2]]

Print option values

Print option values

Attributes

Inherited from:
Printer
final def orElse[Err2 >: Err2, Out2 >: Out, Value2 <: Value2](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Value2]

Prints this and if it fails, ignore the printed output and print 'that' instead.

Prints this and if it fails, ignore the printed output and print 'that' instead.

Attributes

Inherited from:
Printer
final def orElseEither[Err2 >: Err2, Out2 >: Out, Value2](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Either[Value2, Value2]]

Prints this if the input is 'Left', or print 'that' if the input is 'Right'

Prints this if the input is 'Left', or print 'that' if the input is 'Right'

Attributes

Inherited from:
Printer
final def orElseU[Err2 >: Err2, Out2 >: Out, Value1 <: Value2, Value2 : ClassTag](that: => Printer[Err2, Out2, Value2])(implicit evidence$1: ClassTag[Value2], vtag: ClassTag[Value1]): Printer[Err2, Out2, Value1 | Value2]

Prints this and if it fails, ignore the printed output and print 'that' instead.

Prints this and if it fails, ignore the printed output and print 'that' instead.

Attributes

Inherited from:
VersionSpecificPrinter
final def printString(value: Value2)(implicit ev: Out <:< Char): Either[Err2, String]

Print the given 'value' to a string

Print the given 'value' to a string

Attributes

Inherited from:
Printer
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
final def repeat: Printer[Err2, Out, Chunk[Value2]]

Repeats this printer for each element of the input chunk, assuming it has at least one element

Repeats this printer for each element of the input chunk, assuming it has at least one element

Attributes

Inherited from:
Printer
final def repeat0: Printer[Err2, Out, Chunk[Value2]]

Repeats this printer for each element of the input chunk, zero or more times

Repeats this printer for each element of the input chunk, zero or more times

Attributes

Inherited from:
Printer
final def repeatUntil[Err2 >: Err2, Out2 >: Out](stopCondition: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Chunk[Value2]]

Repeat this printer for each element of the input chunk, verifying the 'stopConfition' after each.

Repeat this printer for each element of the input chunk, verifying the 'stopConfition' after each.

Attributes

Inherited from:
Printer
final def repeatWithSep[Err2 >: Err2, Out2 >: Out](sep: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Chunk[Value2]]

Repeats this printer for each element of the input chunk, separated by the 'sep' printer (which gets Unit to be printed)

Repeats this printer for each element of the input chunk, separated by the 'sep' printer (which gets Unit to be printed)

Attributes

Inherited from:
Printer
final def repeatWithSep0[Err2 >: Err2, Out2 >: Out](sep: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Chunk[Value2]]

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)

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)

Attributes

Inherited from:
Printer
final def surroundedBy[Err2 >: Err2, Out2 >: Out](other: Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Value2]

Surround this printer with 'other', which will get Unit as value to be printed.

Surround this printer with 'other', which will get Unit as value to be printed.

Attributes

Inherited from:
Printer
final def transformOption[Value2](from: Value2 => Option[Value2]): Printer[Option[Err2], Out, Value2]

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.

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.

Attributes

Inherited from:
Printer
final def widenWith[Err2 >: Err2, Value2](narrow: PartialFunction[Value2, Value2], 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.

Widen this printer's printed value type by specifying a partial function to narrow it back to the set of supported subtypes.

Attributes

Inherited from:
Printer
final def zipLeft[Err2 >: Err2, Out2 >: Out](that: => Printer[Err2, Out2, Unit]): Printer[Err2, Out2, Value2]

Print 'that' by providing the unit value to it after printing this. The result is this printer's result.

Print 'that' by providing the unit value to it after printing this. The result is this printer's result.

Attributes

Inherited from:
Printer
final def |[Err2 >: Err2, Out2 >: Out, Value2 <: Value2](that: => Printer[Err2, Out2, Value2]): Printer[Err2, Out2, Value2]

Symbolic alias for orElse

Symbolic alias for orElse

Attributes

Inherited from:
Printer