StringErrSyntaxOps

zio.parser.`package`.StringErrSyntaxOps
final implicit class StringErrSyntaxOps[In, Out, Value](self: Syntax[String, In, Out, Value]) extends AnyVal

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def widen[D](implicit ev: Value <:< D, tag: ClassTag[Value]): Syntax[String, In, Out, D]

Widens the parser to a supertype of its result

Widens the parser to a supertype of its result

This is useful in combination with the orElse (<>) operator. For example a JSON parser can be expressed by a combination of parsers for the individual json type widened to Json:

nul.widen[Json] <>
bool.widen[Json] <>
str.widen[Json] <>
num.widen[Json] <>
list.widen[Json] <>
obj.widen[Json]

Attributes