public static ParserResult <T> ConsumedError <T>(ParserError error) => new ParserResult <T>(ResultTag.Consumed, Reply.Error <T>(error));
public static ParserResult <T> EmptyError <T>(ParserError error) => new ParserResult <T>(ResultTag.Empty, Reply.Error <T>(error));
public static ParserResult <I, O> EmptyError <I, O>(ParserError error, Func <I, Pos> tokenPos) => new ParserResult <I, O>(ResultTag.Empty, Reply.Error <I, O>(error, tokenPos));
public static ParserResult <I, O> ConsumedError <I, O>(ParserError error, Func <I, Pos> tokenPos) => new ParserResult <I, O>(ResultTag.Consumed, Reply.Error <I, O>(error, tokenPos));
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));