예제 #1
0
 /// <summary>
 ///     Creates a new IOption(U) from an IOption(T) by converting the potentially contained
 ///     value, using a given conversion function.
 /// </summary>
 /// <typeparam name="T">Type of the value originally contained.</typeparam>
 /// <typeparam name="U">Type of the new value potentially contained.</typeparam>
 /// <param name="option">An option to Select over.</param>
 /// <param name="selector">A function used to convert the potential value.</param>
 public static IOption <U> Select <T, U>(this IOption <T> option, Func <T, U> selector)
 {
     return(option.Bind(x => Some(selector(x))));
 }