mads

package mads

Type members

Classlikes

final case class Mads[A](repr: Representation[A])(using monoid: Monoid[A])
Companion
object
object Mads
Companion
class
enum Parser[A]

A parser that produces a value of type A.

A parser that produces a value of type A.

The context is used to represent the possibility of resuming the parser with additional input and, optionally, already parsed input. There are two context types provided:

  • Complete which is the result type for parsers that cannot be resumed.
  • Resumable, which is the result type for parsers that can be resumed.

There are three cases within Complete:

  • Epsilon, for a parser that failed but did not consume any input;
  • Committed, for a parser that failed after consuming some input; and
  • Success, for a parser that successfully parsed a portion of it's input and produced a value of type A.

Resumable adds an additional cause for a parser that can be resumed.

Parsers can be resumed if they accept their complete input but do not parse it. In other words, a parser that Committed to its entire input. Additionally, the programmer must indicate that a parser can be resumed using the resumable method.

Resumption is quite limited. The original input is not reparsed on resumption. Parsing starts again on the new input and hence a parser cannot carry state across resumption boundaries.

Companion
object
object Parser
Companion
class
object Parser0

Parsers constructed through these methods consume zero or more characters

Parsers constructed through these methods consume zero or more characters

trait Representation[A]
enum Resumable[S, A]

A result type for a parser that may be able to be resumed with additional input

A result type for a parser that may be able to be resumed with additional input

  • A is the type of output
  • S is the type of suspended output
Companion
object
object Resumable
Companion
class
enum Suspendable[S, A]

A parser that can be suspended

A parser that can be suspended

  • S is the type of suspended values
  • A is the type of output
Companion
object
object Suspendable
Companion
class
object TextRepresentation extends Representation[String]
object continuation