public static Maybe<TResult> SelectMany<TSource, TCollection, TResult>(this Maybe<TSource> self,
Func<TSource, Maybe<TCollection>> selector,
Func<TSource, TCollection, TResult> resultSelector)
{
Check.Selector (selector);
Check.ResultSelector (resultSelector);
if (!self.HasValue)
return Maybe<TResult>.Nothing;
Maybe<TCollection> n = selector (self.Value);
if (!n.HasValue)
return Maybe<TResult>.Nothing;
return resultSelector(self.Value, n.Value).ToMaybe ();
}