public static IOption <T> TryParse <T>(string str, ParserDelegate <T> parser) => parser(str, out var perhapsResult) ? Some.Of(perhapsResult) : new None <T>();
public static IOption <TElem> TryKey <TKey, TElem>(TKey key, IDictionary <TKey, TElem> dict) => dict.ContainsKey(key) ? Some.Of(dict[key]) : new None <TElem>();
public static IOption <T> FromMaybeNull <T>(T value) where T : class => value != null?Some.Of(value) : new None <T>();
public static IOption <TElem> TryFind <TElem>(IEnumerable <TElem> values, Func <TElem, bool> predicate) => values.Any(predicate) ? Some.Of(values.First(predicate)) : new None <TElem>();
public static IOption <T> FromNullable <T>(T?value) where T : struct => value.HasValue ? Some.Of(value.Value) : new None <T>();