local result = require("lib/result") type Result = result.Result local Ok = result.Ok local Err = result.Err local function canError(): Result if math.round(math.random()) == 1 then return Err("you DIED") end return Ok(69) end function main() local val = canError():unwrap() print("got value: ", val) end return main()