public static Reply <T> mergeErrorReply <T>(ParserError err, Reply <T> reply) => reply.Tag == ReplyTag.OK ? Reply.OK(reply.Result, reply.State, mergeError(err, reply.Error)) : Reply.Error <T>(mergeError(err, reply.Error));
internal ParserResult(ResultTag tag, Reply <I, O> reply) { Tag = tag; Reply = reply; }
public static ParserResult <I, O> Consumed <I, O>(Reply <I, O> reply) => new ParserResult <I, O>(ResultTag.Consumed, reply);
public static ParserResult <I, O> ConsumedOK <I, O>(O value, PString <I> input, ParserError error) => new ParserResult <I, O>(ResultTag.Consumed, Reply.OK(value, input, error));
public static ParserResult <I, O> ConsumedError <I, O>(ParserError error) => new ParserResult <I, O>(ResultTag.Consumed, Reply.Error <I, O>(error));
public static ParserResult <I, O> EmptyOK <I, O>(O value, PString <I> input, ParserError error = null) => new ParserResult <I, O>(ResultTag.Empty, Reply.OK(value, input, error));
public static ParserResult <I, O> EmptyError <I, O>(ParserError error) => new ParserResult <I, O>(ResultTag.Empty, Reply.Error <I, O>(error));
public static ParserResult <I, O> Empty <I, O>(Reply <I, O> reply) => new ParserResult <I, O>(ResultTag.Empty, reply);
public static ParserResult <T> ConsumedOK <T>(T value, PString input, ParserError error) => new ParserResult <T>(ResultTag.Consumed, Reply.OK(value, input, error));
public static ParserResult <T> EmptyOK <T>(T value, PString input, ParserError error = null) => new ParserResult <T>(ResultTag.Empty, Reply.OK(value, input, error));
public static ParserResult <T> Empty <T>(Reply <T> reply) => new ParserResult <T>(ResultTag.Empty, reply);
public static ParserResult <T> Consumed <T>(Reply <T> reply) => new ParserResult <T>(ResultTag.Consumed, reply);