scalaparsers.Result.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parser_2.11 Show documentation
Show all versions of parser_2.11 Show documentation
A Trifecta inspired parser in Scala.
The newest version!
package scalaparsers
sealed abstract class Result[+S,+A] extends Functorial[Result[S,+?],A] {
def self = this
}
case class Success[+S,+A](body: A, state : S) extends Result[S,A] {
def map[B](f: A => B) = Success(f(body), state)
}
case class Failure(error: Option[Document], stack: List[String]) extends Result[Nothing,Nothing] {
def map[B](f: Nothing => B) = this
override def as[B](b: => B) = this
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy