enum Result Ok(T), Err(E) end int Error message: String end class BadArgumentError(argument: String) : Error pub message = "Invalid argument: ${argument}" end fn main(args: Array) -> Result let left = args.get(0).flatMap(Int::parse) if left is None then return Err(BadArgumentError(args.get(0))) end let right = args.get(1).flatMap(Int::parse) if right is None then return Err(BadArgumentError(args.get(1))) end Ok(left.unwrap() + right.unwrap()) end