function Option.Match(d,R)local e=R.Some local B=R.None assert(type(e)=="\102\117\110\099\116\105\111\110","\077\105\115\115\105\110\103 \'\083\111\109\101\' \109\097\116\099\104")assert(type(B)=="\102\117\110\099\116\105\111\110","\077\105\115\115\105\110\103 \'\078\111\110\101\' \109\097\116\099\104")if d:IsSome()then return e(d:Unwrap())else return B()end end
--[=[
	@param matches {Some: (value: any) -> any, None: () -> any}
	@return any

	Matches against the option.

	```lua
	local opt = Option.Some(32)
	opt:Match {
		Some = function(num) print("Number", num) end,
		None = function() print("No value") end,
	}
	```
]=]
function Option:Match(matches)
	local onSome = matches.Some
	local onNone = matches.None
	assert(type(onSome) == "function", "Missing 'Some' match")
	assert(type(onNone) == "function", "Missing 'None' match")
	if self:IsSome() then
		return onSome(self:Unwrap())
	else
		return onNone()
	end
end
