luau-result
v1.0.0
Published
A fast luau implementation of the Result Monad.
Downloads
7
Readme
Result
A fast and minimalistic implementation of the Result Monad.
Example
local function operation(condition)
if condition then
return Ok(10)
else
return Err("'condition' is falsy")
end
end
local multipliedResult = operation(true):and_then(function(value)
return Ok(value * 10)
end)
if multipliedResult:is_ok() then
print(multipliedResult.ok)
end