Bind
Como usar
Option<int> SquareWhenEven(int value)
{
if(element % 2 == 0)
return value * value;
else
return Option<int>.None();
}
Option<int> optionValue = 4;
Option<int> result = optionValue.Bind(SquareWhenEven);
//result.IsSome = true
//result.Some = 8Last updated