← ZIO Parser docs

Parser

zio.parser.Parser
See theParser companion trait
object Parser

Attributes

Companion
trait
Source
Parser.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Parser.type

Members list

Type members

Classlikes

final case class Backtrack[Err, In, Result](parser: Parser[Err, In, Result]) extends Parser[Err, In, Result]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Result]
trait VersionSpecificParser[Err, In, Result]
class Object
trait Matchable
class Any
Show all
final case class CaptureString[Err, Err2](parser: Parser[Err, Char, Any]) extends Parser[Err2, Char, String]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, Char, String]
class Object
trait Matchable
class Any
Show all
case object End extends Parser[Nothing, Any, Unit]

Attributes

Source
Parser.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Parser[Nothing, Any, Unit]
trait VersionSpecificParser[Nothing, Any, Unit]
class Object
trait Matchable
class Any
Show all
Self type
End.type
final case class Fail[+Err](failure: Err) extends Parser[Err, Any, Any]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Any, Any]
trait VersionSpecificParser[Err, Any, Any]
class Object
trait Matchable
class Any
Show all
final case class Failed[+Err](failure: ParserError[Err]) extends Parser[Err, Any, Nothing]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Any, Nothing]
trait VersionSpecificParser[Err, Any, Nothing]
class Object
trait Matchable
class Any
Show all
final case class FlatMap[Err, Err2, In, In2 <: In, Result, Result2](parser: Parser[Err, In, Result], f: Result => Parser[Err2, In2, Result2]) extends Parser[Err2, In2, Result2]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Result2]
trait VersionSpecificParser[Err2, In2, Result2]
class Object
trait Matchable
class Any
Show all
final case class Ignore[Err, Err2, In, Result, Result2](parser: Parser[Err, In, Result], to: Result2) extends Parser[Err2, In, Result2]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In, Result2]
trait VersionSpecificParser[Err2, In, Result2]
class Object
trait Matchable
class Any
Show all
case object Index extends Parser[Nothing, Any, Int]

Attributes

Source
Parser.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Parser[Nothing, Any, Int]
trait VersionSpecificParser[Nothing, Any, Int]
class Object
trait Matchable
class Any
Show all
Self type
Index.type
final case class Lazy[+Err, -In, +Result](inner: () => Parser[Err, In, Result]) extends Parser[Err, In, Result]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Result]
trait VersionSpecificParser[Err, In, Result]
class Object
trait Matchable
class Any
Show all
final case class MapError[Err, Err2, In, Result](parser: Parser[Err, In, Result], mapParserErr: (ParserError[Err]) => ParserError[Err2]) extends Parser[Err2, In, Result]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In, Result]
trait VersionSpecificParser[Err2, In, Result]
class Object
trait Matchable
class Any
Show all
final case class Named[Err, In, Result](parser: Parser[Err, In, Result], name: String) extends Parser[Err, In, Result]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Result]
trait VersionSpecificParser[Err, In, Result]
class Object
trait Matchable
class Any
Show all
final case class Not[Err, In](parser: Parser[Err, In, Any], failure: Err) extends Parser[Err, In, Unit]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Unit]
trait VersionSpecificParser[Err, In, Unit]
class Object
trait Matchable
class Any
Show all
final case class Optional[Err, In, Result](parser: Parser[Err, In, Result]) extends Parser[Err, In, Option[Result]]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Option[Result]]
trait VersionSpecificParser[Err, In, Option[Result]]
class Object
trait Matchable
class Any
Show all
final case class OrElse[Err, Err2, In, In2 <: In, Result, Result2](left: Parser[Err, In, Result], right: Parser[Err2, In2, Result2]) extends Parser[Err2, In2, Result2]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Result2]
trait VersionSpecificParser[Err2, In2, Result2]
class Object
trait Matchable
class Any
Show all
final case class OrElseEither[Err, Err2, In, In2 <: In, Result, Result2](left: Parser[Err, In, Result], right: Parser[Err2, In2, Result2]) extends Parser[Err2, In2, Either[Result, Result2]]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Either[Result, Result2]]
trait VersionSpecificParser[Err2, In2, Either[Result, Result2]]
class Object
trait Matchable
class Any
Show all
final case class ParseRegex[Err](regex: Regex, onFailure: Option[Err]) extends Parser[Err, Char, Chunk[Char]]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Char, Chunk[Char]]
class Object
trait Matchable
class Any
Show all
final case class ParseRegexLastChar[Err](regex: Regex, onFailure: Option[Err]) extends Parser[Err, Char, Char]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Char, Char]
class Object
trait Matchable
class Any
Show all
object ParserError

Attributes

Companion
trait
Source
Parser.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ParserError[+Err]

Type representing a parser error

Type representing a parser error

Attributes

Companion
object
Source
Parser.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AllBranchesFailed[Err]
class Failure[Err]
class NotConsumedAll[Err]
Self type
final case class Passthrough[-D1, +D2]() extends Parser[Nothing, D1, D2]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Nothing, D1, D2]
trait VersionSpecificParser[Nothing, D1, D2]
class Object
trait Matchable
class Any
Show all
final case class Repeat[Err, In, Result](parser: Parser[Err, In, Result], min: Int, max: Option[Int]) extends Parser[Err, In, Chunk[Result]]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Chunk[Result]]
trait VersionSpecificParser[Err, In, Chunk[Result]]
class Object
trait Matchable
class Any
Show all
final case class SetAutoBacktrack[Err, In, Result](parser: Parser[Err, In, Result], enabled: Boolean) extends Parser[Err, In, Result]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, In, Result]
trait VersionSpecificParser[Err, In, Result]
class Object
trait Matchable
class Any
Show all
final case class SkipRegex[Err](regex: Regex, onFailure: Option[Err]) extends Parser[Err, Char, Unit]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err, Char, Unit]
class Object
trait Matchable
class Any
Show all
final case class Succeed[+Result](value: Result) extends Parser[Nothing, Any, Result]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Nothing, Any, Result]
trait VersionSpecificParser[Nothing, Any, Result]
class Object
trait Matchable
class Any
Show all
final case class Transform[Err, Err2, In, Result, Result2](parser: Parser[Err, In, Result], to: Result => Result2) extends Parser[Err2, In, Result2]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In, Result2]
trait VersionSpecificParser[Err2, In, Result2]
class Object
trait Matchable
class Any
Show all
final case class TransformEither[Err, Err2, In, Result, Result2](parser: Parser[Err, In, Result], to: Result => Either[Err2, Result2]) extends Parser[Err2, In, Result2]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In, Result2]
trait VersionSpecificParser[Err2, In, Result2]
class Object
trait Matchable
class Any
Show all
final case class Zip[Err, Err2, In, In2 <: In, Result, Result2, ZippedResult](left: Parser[Err, In, Result], right: Parser[Err2, In2, Result2], zip: (Result, Result2) => ZippedResult) extends Parser[Err2, In2, ZippedResult]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, ZippedResult]
trait VersionSpecificParser[Err2, In2, ZippedResult]
class Object
trait Matchable
class Any
Show all
final case class ZipLeft[Err, Err2, In, In2 <: In, Result](left: Parser[Err, In, Result], right: Parser[Err2, In2, Any]) extends Parser[Err2, In2, Result]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Result]
trait VersionSpecificParser[Err2, In2, Result]
class Object
trait Matchable
class Any
Show all
final case class ZipRight[Err, Err2, In, In2 <: In, Result, Result2](left: Parser[Err, In, Result], right: Parser[Err2, In2, Result2]) extends Parser[Err2, In2, Result2]

Attributes

Source
Parser.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Parser[Err2, In2, Result2]
trait VersionSpecificParser[Err2, In2, Result2]
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def any[T]: Parser[Nothing, T, T]

Attributes

Source
Parser.scala
def char(value: Char): Parser[String, Char, Unit]

Parser that consumes the exact character 'value' or fails if it did not match, and results in the unit value.

Parser that consumes the exact character 'value' or fails if it did not match, and results in the unit value.

Attributes

Source
Parser.scala
def char[Err](value: Char, failure: Err): Parser[Err, Char, Unit]

Parser that consumes the exact character 'value' or fails with 'failure' if it did not match, and results in the unit value

Parser that consumes the exact character 'value' or fails with 'failure' if it did not match, and results in the unit value

Attributes

Source
Parser.scala
def charIn(chars: Char*): Parser[String, Char, Char]

Parser that consumes a single character and succeeds with it if it is one of the provided 'chars'

Parser that consumes a single character and succeeds with it if it is one of the provided 'chars'

Attributes

Source
Parser.scala
def charNotIn(chars: Char*): Parser[String, Char, Char]

Parser that consumes a single character and succeeds with it if it is NOT one of the provided 'chars'

Parser that consumes a single character and succeeds with it if it is NOT one of the provided 'chars'

Attributes

Source
Parser.scala
def fail[Err](failure: Err): Parser[Err, Any, Nothing]

Parser that always fails with 'failure'

Parser that always fails with 'failure'

Attributes

Source
Parser.scala
def notChar(value: Char): Parser[String, Char, Char]

Parser that consumes a single character, fails if it is 'value', otherwise results with it

Parser that consumes a single character, fails if it is 'value', otherwise results with it

Attributes

Source
Parser.scala
def notChar[Err](value: Char, failure: Err): Parser[Err, Char, Char]

Parser that consumes a single character, fails with 'failure' if it is 'value', otherwise results with it

Parser that consumes a single character, fails with 'failure' if it is 'value', otherwise results with it

Attributes

Source
Parser.scala
def regex[Err](regex: Regex, failure: Err): ParseRegex[Err]

Parser that executes a regular expression on the input and results in the chunk of the parsed characters, or fails with 'failure'.

Parser that executes a regular expression on the input and results in the chunk of the parsed characters, or fails with 'failure'.

Attributes

Source
Parser.scala
def regexChar[Err](regex: Regex, failure: Err): ParseRegexLastChar[Err]

Parser that executes a regular expression on the input and results in the last parsed character, or fails with 'failure'. Useful for regexes that are known to parse a single character.

Parser that executes a regular expression on the input and results in the last parsed character, or fails with 'failure'. Useful for regexes that are known to parse a single character.

Attributes

Source
Parser.scala
def regexDiscard[Err](regex: Regex, failure: Err): Parser[Err, Char, Unit]

Parser that executes a regular expression on the input but discards its result, and fails with 'failure' if the regex fails

Parser that executes a regular expression on the input but discards its result, and fails with 'failure' if the regex fails

Attributes

Source
Parser.scala
def string[Result](str: String, value: Result): Parser[String, Char, Result]

Parser that requires a given string 'str' and in case it could read it, results in 'value'

Parser that requires a given string 'str' and in case it could read it, results in 'value'

Attributes

Source
Parser.scala
def succeed[Result](value: Result): Parser[Nothing, Any, Result]

Parser that does not consume any input and succeeds with 'value'

Parser that does not consume any input and succeeds with 'value'

Attributes

Source
Parser.scala
def unsafeRegex(regex: Regex): ParseRegex[Nothing]

Parser that executes a regular expression on the input and results in the chunk of the parsed characters. The regex is supposed to never fail.

Parser that executes a regular expression on the input and results in the chunk of the parsed characters. The regex is supposed to never fail.

Attributes

Source
Parser.scala

Parser that executes a regular expression on the input and results in the last parsed character. The regex is supposed to never fail. Useful for regexes that are known to parse a single character.

Parser that executes a regular expression on the input and results in the last parsed character. The regex is supposed to never fail. Useful for regexes that are known to parse a single character.

Attributes

Source
Parser.scala
def unsafeRegexDiscard(regex: Regex): Parser[Nothing, Char, Unit]

Parser that executes a regular expression on the input but discards its result. The regex is supposed to never fail.

Parser that executes a regular expression on the input but discards its result. The regex is supposed to never fail.

Attributes

Source
Parser.scala

Concrete fields

Parser of a single alpha-numeric character

Parser of a single alpha-numeric character

Attributes

Source
Parser.scala
val anyChar: Parser[Nothing, Char, Char]

Parser that consumes a single character and returns it

Parser that consumes a single character and returns it

Attributes

Source
Parser.scala
val anyString: Parser[Nothing, Char, String]

Parser that consumes the whole input and captures it as a string

Parser that consumes the whole input and captures it as a string

Attributes

Source
Parser.scala
lazy val digit: Parser[String, Char, Char]

Parser of a single digit

Parser of a single digit

Attributes

Source
Parser.scala
lazy val end: Parser[Nothing, Any, Unit]

Parser that only succeeds if the input stream has been consumed fully.

Parser that only succeeds if the input stream has been consumed fully.

This can be used to require that a parser consumes the full input.

Attributes

Source
Parser.scala
lazy val ignoreRest: Parser[Nothing, Char, Unit]

Parser that consumes and discards all the remaining input

Parser that consumes and discards all the remaining input

Attributes

Source
Parser.scala
lazy val index: Parser[Nothing, Any, Int]

Parser that results in the current input stream position

Parser that results in the current input stream position

Attributes

Source
Parser.scala
lazy val letter: Parser[String, Char, Char]

Parser of a single letter

Parser of a single letter

Attributes

Source
Parser.scala
lazy val unit: Parser[Nothing, Any, Unit]

Parser that does not consume the input and results in unit

Parser that does not consume the input and results in unit

Attributes

Source
Parser.scala

Parser of a single whitespace character

Parser of a single whitespace character

Attributes

Source
Parser.scala