Counter-intuitively, if you're writing a parser for a programming language, you need it to be a total function. As soon as you build IDE tooling, you need ASTs from invalid or incomplete input. The parser should return (Ast, List<Error>) rather than Result<Ast, Error>.