public void IfHasValue(Action <T> action) { Checker.Null <ArgumentNullException>(action); if (HasValue) { action(value); } }
public IMaybe <TResult> Bind <TResult>(Func <T, IMaybe <TResult> > function) { Checker.Null <ArgumentNullException>(function); if (HasValue) { return(function.Invoke(value)); } return(Maybe <TResult> .None); }
public T ValueOr(Func <T> function) { Checker.Null <ArgumentNullException>(function); if (HasValue) { return(value); } return(function.Invoke()); }
public T ValueOr(Func <T> function) { Checker.Null <ArgumentNullException>(function); return(value); }
public IMaybe <TResult> Bind <TResult>(Func <T, TResult> function) { Checker.Null <ArgumentNullException>(function); return(Maybe <TResult> .Of(function.Invoke(value))); }
public void IfHasValue(Action <T> action) { Checker.Null <ArgumentNullException>(action); action.Invoke(value); }
public IMaybe <TResult> Bind <TResult>(Func <T, IMaybe <TResult> > function) { Checker.Null <ArgumentNullException>(function); return(None <TResult> .Of()); }