public static PipedFunction <IEnumerable <string>, IEnumerable <TOutput> > ParseAllTo <TOutput>() => Piped.FromFunc <IEnumerable <string>, IEnumerable <TOutput> >(list => list.Select(str => { var descr = TypeDescriptor.GetConverter(typeof(TOutput)); if (descr.CanConvertFrom(typeof(string))) { return((TOutput)descr.ConvertFromString(str)); } throw Error(nameof(ParseAllTo)); }));
public static PipedFunction <string, string> Join(string separator, params string[] strArray) => Piped.FromFunc <string, string>(str => string.Join(separator, new[] { str }.Union(strArray)));
public static PipedFunction <IEnumerable <TInput>, IEnumerable <TInput> > Where(Func <TInput, bool> filter) => Piped.FromFunc <IEnumerable <TInput>, IEnumerable <TInput> >(list => list.Where(filter));
public static PipedFunction <IEnumerable <TInput>, IEnumerable <TOutput> > Select <TOutput>(Func <TInput, TOutput> selector) => Piped.FromFunc <IEnumerable <TInput>, IEnumerable <TOutput> >(list => list.Select(selector));
public static PipedFunction <string, IEnumerable <string> > Split(params char[] separators) => Piped.FromFunc <string, IEnumerable <string> >(str => str.Split(separators));