Polymorphic variants and let%bind type error
问题 I'm trying to use the technique in Composable Error Handling in OCaml (Result type with polymorphic variants for errors) for some code I've written. The types of the functions I'm trying to use look like this: val parse : parser -> token list -> (Nominal.term, [> `ParseError of string ]) Result.t val lex : lexer -> string -> (token list, [> `LexError of string ]) Result.t My attempt at composing them is this: let lex_and_parse : parser -> lexer -> string -> (Nominal.term, [> `ParseError of