Parsed

sealed abstract class Parsed[+T]

Represents the result of a Parser, a value of type T in case of success, a message in case of failure as well as the SourceCursor for the remaining input.

class Object
trait Matchable
class Any
class Failure
class Success[T]

Value members

Abstract methods

def map[U](f: T => U): Parsed[U]

Builds a new Parsed instance by applying the specified function to the result of this instance.

Builds a new Parsed instance by applying the specified function to the result of this instance.

def orElse[U >: T](default: => Parsed[U]): Parsed[U]

Returns this Parsed instance if the parser succeeded or otherwise the specified fallback instance.

Returns this Parsed instance if the parser succeeded or otherwise the specified fallback instance.

def toEither: Either[String, T]

The result as an Either, a Left in case of failure.

The result as an Either, a Left in case of failure.

def toOption: Option[T]

The result as an Option, empty in case of failure.

The result as an Option, empty in case of failure.

Concrete methods

def getOrElse[B >: T](default: => B): B

Returns the result value from the parser invocation if the parser succeeded or otherwise the specified fallback value.

Returns the result value from the parser invocation if the parser succeeded or otherwise the specified fallback value.

def isFailure: Boolean

Indicates whether this results represents an unsuccessful parser invocation.

Indicates whether this results represents an unsuccessful parser invocation.

Abstract fields

val isSuccess: Boolean

Indicates whether this results represents a successful parser invocation.

Indicates whether this results represents a successful parser invocation.

The context representing the remaining input left over by the parser that produced this result.

The context representing the remaining input left over by the parser that produced this result.