Packages

  • package root

    This is the documentation for Parsley.

    This is the documentation for Parsley.

    Package structure

    The parsley package contains the Parsley class, as well as the Result, Success, and Failure types. In addition to these, it also contains the following packages and "modules" (a module is defined as being an object which mocks a package):

    • parsley.Parsley contains the bulk of the core "function-style" combinators, as well as the implicit classes which enable the "method-style" combinators.
    • parsley.combinator contains many helpful combinators that simplify some common parser patterns.
    • parsley.character contains the combinators needed to read characters and strings, as well as combinators to match specific sub-sets of characters.
    • parsley.debug contains debugging combinators, helpful for identifying faults in parsers.
    • parsley.io contains extension methods to run parsers with input sourced from IO sources.
    • parsley.expr contains the following sub modules:
    • parsley.implicits contains several implicits to add syntactic sugar to the combinators. These are sub-categorised into the following sub modules:
      • parsley.implicits.character contains implicits to allow you to use character and string literals as parsers.
      • parsley.implicits.combinator contains implicits related to combinators, such as the ability to make any parser into a Parsley[Unit] automatically.
      • parsley.implicits.lift enables postfix application of the lift combinator onto a function (or value).
      • parsley.implicits.zipped enables boths a reversed form of lift where the function appears on the right and is applied on a tuple (useful when type inference has failed) as well as a .zipped method for building tuples out of several combinators.
    • parsley.errors contains modules to deal with error messages, their refinement and generation.
      • parsley.errors.combinator provides combinators that can be used to either produce more detailed errors as well as refine existing errors.
    • parsley.lift contains functions which lift functions that work on regular types to those which now combine the results of parsers returning those same types. these are ubiquitous.
    • parsley.registers contains combinators that interact with the context-sensitive functionality in the form of registers.
    • parsley.token contains the Lexer class that provides a host of helpful lexing combinators when provided with the description of a language.
    • parsley.unsafe contains unsafe (and not thread-safe) ways of speeding up the execution of a parser.
    Definition Classes
    root
  • package parsley
    Definition Classes
    root
  • package errors
    Definition Classes
    parsley
  • package expr
    Definition Classes
    parsley
  • package implicits
    Definition Classes
    parsley
  • package token
    Definition Classes
    parsley
  • Failure
  • Parsley
  • Parsley212
  • Result
  • Success
  • character
  • combinator
  • debug
  • lift
  • registers
  • unsafe
c

parsley

Success

case class Success[A] extends Result[Nothing, A] with Product with Serializable

Returned when a parser succeeded.

A

The type of expected success result

Linear Supertypes
Serializable, Serializable, Product, Equals, Result[Nothing, A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Success
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Result
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def contains[B >: A](elem: B): Boolean

    Returns true if this is a Success and its value is equal to elem (as determined by ==), returns false otherwise.

    Returns true if this is a Success and its value is equal to elem (as determined by ==), returns false otherwise.

    elem

    the element to test.

    returns

    true if this is a Success value equal to elem.

    Definition Classes
    Result
    Since

    1.7.0

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def exists(p: (A) ⇒ Boolean): Boolean

    Returns false if Failure or returns the result of the application of the given predicate to the Success value.

    Returns false if Failure or returns the result of the application of the given predicate to the Success value.

    Definition Classes
    Result
    Since

    1.7.0

  9. def filterOrElse[Err_ >: Nothing](p: (A) ⇒ Boolean, msg: ⇒ Err_): Result[Err_, A]

    Returns Success with the existing value of Success if this is a Success and the given predicate p holds for the right value, or Failure(msg) if this is a Success and the given predicate p does not hold for the right value, or Failure with the existing value of Failure if this is a Failure.

    Returns Success with the existing value of Success if this is a Success and the given predicate p holds for the right value, or Failure(msg) if this is a Success and the given predicate p does not hold for the right value, or Failure with the existing value of Failure if this is a Failure.

    Definition Classes
    Result
    Since

    1.7.0

  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def flatMap[B, Err_ >: Nothing](f: (A) ⇒ Result[Err_, B]): Result[Err_, B]

    Binds the given function across Success.

    Binds the given function across Success.

    f

    The function to bind across Success.

    Definition Classes
    Result
    Since

    1.7.0

  12. def flatten[B, Err_ >: Nothing](implicit ev: <:<[A, Result[Err_, B]]): Result[Err_, B]

    Returns the right value if this is right or this value if this is left

    Returns the right value if this is right or this value if this is left

    Equivalent to flatMap(id => id)

    Definition Classes
    Result
    Since

    1.7.0

  13. def fold[B](ferr: (Nothing) ⇒ B, fa: (A) ⇒ B): B

    Applies fa if this is a Failure or fb if this is a Success.

    Applies fa if this is a Failure or fb if this is a Success.

    ferr

    the function to apply if this is a Failure

    fa

    the function to apply if this is a Success

    returns

    the results of applying the function

    Definition Classes
    Result
    Since

    1.7.0

  14. def forall(f: (A) ⇒ Boolean): Boolean

    Returns true if Failure or returns the result of the application of the given predicate to the Success value.

    Returns true if Failure or returns the result of the application of the given predicate to the Success value.

    Definition Classes
    Result
    Since

    1.7.0

  15. def foreach[U](f: (A) ⇒ U): Unit

    Executes the given side-effecting function if this is a Success.

    Executes the given side-effecting function if this is a Success.

    f

    The side-effecting function to execute.

    Definition Classes
    Result
    Since

    1.7.0

  16. def get: A

    Returns the results's value.

    Returns the results's value.

    Definition Classes
    SuccessResult
    Since

    1.7.0

    Exceptions thrown

    java.util.NoSuchElementException if the result is a failure.

    Note

    The result must not be a failure.

  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def getOrElse[B >: A](or: ⇒ B): B

    Returns the value from this Success or the given argument if this is a Failure.

    Returns the value from this Success or the given argument if this is a Failure.

    Definition Classes
    Result
    Since

    1.7.0

  19. def isFailure: Boolean

    Returns true if this is a Failure, false otherwise.

    Returns true if this is a Failure, false otherwise.

    Definition Classes
    SuccessResult
    Since

    1.7.0

  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def isSuccess: Boolean

    Returns true if this is a Success, false otherwise.

    Returns true if this is a Success, false otherwise.

    Definition Classes
    SuccessResult
    Since

    1.7.0

  22. def map[B](f: (A) ⇒ B): Result[Nothing, B]

    The given function is applied if this is a Success.

    The given function is applied if this is a Success.

    Definition Classes
    Result
    Since

    1.7.0

  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. def orElse[B >: A, Err_ >: Nothing](or: ⇒ Result[Err_, B]): Result[Err_, B]

    Returns this Success or the given argument if this is a Failure.

    Returns this Success or the given argument if this is a Failure.

    Definition Classes
    Result
    Since

    1.7.0

  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toEither: Either[Nothing, A]

    Converts the Result into a Either where Failure maps to a Left[Err]

    Converts the Result into a Either where Failure maps to a Left[Err]

    Definition Classes
    Result
    Since

    1.7.0

  29. def toOption: Option[A]

    Returns a Some containing the Success value if it exists or a None if this is a Failure.

    Returns a Some containing the Success value if it exists or a None if this is a Failure.

    Definition Classes
    Result
    Since

    1.7.0

  30. def toSeq: Seq[A]

    Returns a Seq containing the Success value if it exists or an empty Seq if this is a Failure.

    Returns a Seq containing the Success value if it exists or an empty Seq if this is a Failure.

    Definition Classes
    Result
    Since

    1.7.0

  31. def toTry: Try[A]

    Converts the Result into a Try where Failure maps to a plain Exception

    Converts the Result into a Try where Failure maps to a plain Exception

    Definition Classes
    Result
    Since

    1.7.0

  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  35. val x: A

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Result[Nothing, A]

Inherited from AnyRef

Inherited from Any

Ungrouped