Beispiel #1
0
 /// <summary>
 /// See also https://msdn.microsoft.com/en-us/library/bb352408(v=vs.110).aspx
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="input"></param>
 /// <returns></returns>
 public static Bag <Option <T> > Min <T>(this Bag <T> input)
     where T : IComparable
 => input.Aggregate((a, b) => a.CompareTo(b) <= 0 ? a : b);
Beispiel #2
0
 public static Bag <bool> AllTrue(this Bag <bool> input)
 => input.Aggregate(true, (a, b) => a && b);
Beispiel #3
0
 public static Bag <bool> AnyTrue(this Bag <bool> input)
 => input.Aggregate(false, (a, b) => a || b);
Beispiel #4
0
 public static Bag <T> Sum <P, T>(this P policy, Bag <T> input)
     where P : struct, INumericPolicy <T>
 => input.Aggregate(policy.FromLong(0), policy.Plus);