Reply

is the 4-case result of running a parser: OkConsumed, OkEmpty, ErrConsumed, ErrEmpty. The consumed/empty distinction drives Parsec-style backtracking. Parser.parse collapses this into a Result; Reply surfaces only when writing custom combinators that call Parser.run directly.

ErrConsumed

template

(Fn [ParseErr] (Reply a))

creates a ErrConsumed.

ErrEmpty

template

(Fn [ParseErr] (Reply a))

creates a ErrEmpty.

OkConsumed

template

(Fn [a, Cursor] (Reply a))

creates a OkConsumed.

OkEmpty

template

(Fn [a, Cursor] (Reply a))

creates a OkEmpty.

copy

template

(Fn [(Ref (Reply a) b)] (Reply a))

copies a Reply.

delete

template

(Fn [(Reply a)] ())

deletes a Reply. This should usually not be called manually.

get-tag

instantiate

(Fn [(Ref (Reply a) b)] Int)

Gets the tag from a Reply.

prn

template

(Fn [(Ref (Reply a) b)] String)

converts a Reply to a string.

str

template

(Fn [(Ref (Reply a) b)] String)

converts a Reply to a string.