enum struct Result { T: Ok E: Err impl: inline fn Result.Ok(T) -> [Result] cast(Result::Ok) inline fn Result.Err(E) -> [Result] cast(Result::Err) fn Result.is_ok(&Result) -> [bool] { @ match { Result::Ok { true } Result::Err { false } } } inline fn Result.is_err(&Result) -> [bool] { Result.is_ok lnot } inline fn Result.take_is_ok(Result: self) -> [bool] { &self Result.is_ok } inline fn Result.take_is_err(Result: self) -> [bool] { &self Result.is_err } fn Result.unwrap(Result) -> [T] match { Result::Ok as [t] { t } Result::Err { "Tried to `unwrap` an Error result" println 1 exit } } fn Result.unwrap_err(Result) -> [E] match { Result::Err as [e] { e } Result::Ok { "Tried to `unwrap_err` an Ok result" println 1 exit } } fn Result.ok(Result) -> [Option] match { Result::Ok as [t] { t Option.Some } Result::Err { Option.None:: } } }