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 <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> ConsumedOK <I, O>(O value, PString <I> input, ParserError error) => new ParserResult <I, O>(ResultTag.Consumed, Reply.OK(value, input, error));
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));