示例#1
0
 public static IOption <T> FromMaybeNull <T>(T v) where T : class
 {
     return(v != null?Some.Of(v) : new None <T>());
 }
示例#2
0
 public static IOption <T> FromNullable <T>(T?v) where T : struct
 {
     return(v.HasValue ? Some.Of(v.Value) : new None <T>());
 }