using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BotSharp.Algorithm.Extensions
{
public static partial class IListExtensions
{
///
/// equivalent reduce function in Python
/// https://docs.python.org/3/library/functools.html?highlight=reduce#functools.reduce
///
///
///
///
///
public static TAccumulate Reduce(this IList source, Func func)
{
return source.Skip(1).Aggregate(source[0], func);
}
}
}