module Dolos class Result[A] end class Success[A] < Result[A] attr_reader captures: Array[untyped] attr_reader length: Integer attr_reader value: A def capture!: -> Success[A] def failure?: -> bool def success?: -> bool end class Failure < Result[bot] @message_proc: ^-> String @message_evaluated: bool @message_value: String @state: ParserState attr_reader committed: bool attr_reader error_position: Integer attr_reader message: String def captures: -> [] def failure?: -> bool def map: [B](^(bot) -> B) -> Result[B] def pretty_print: -> String def success?: -> bool end end