Opt

jaskell.parsec.Opt
See theOpt companion object
class Opt[E, T](val p: Parsec[E, T], val otherwise: T) extends Parsec[E, T]

Opt x p tries to apply parser p. If p fails without consuming input, it returns the value x, otherwise the value returned by p.

Attributes

Version:

1.0.0

Companion:
object
Graph
Supertypes
trait Parsec[E, T]
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def apply(s: State[E]): Try[T]

Inherited methods

def !(state: State[E]): B

Attributes

Inherited from:
Parsec
def <?>[C >: T](message: String): Parsec[A, C]

Attributes

Inherited from:
Parsec
def <|>[R >: T](p: Parsec[E, R]): Parsec[A, R]

Attributes

Inherited from:
Parsec
def ?(state: State[E]): Try[B]

Attributes

Inherited from:
Parsec
def attempt: Parsec[A, B]

Attributes

Inherited from:
Parsec
def iterate[R >: T](state: State[E]): Iterator[A, R]

Attributes

Inherited from:
Parsec

Concrete fields

val otherwise: T
val p: Parsec[E, T]
lazy val psc: Attempt[E, T]