static void ExpressionsStreamDemo() => InputNumberSequences .Select(new ExpressionStream().DistinctFor) .SelectMany(expressions => Report(expressions, "No expressions found.")) .WriteLinesTo(Console.Out);
static void CountExpressions() => InputNumberSequences .Select(inputs => new ExpressionStream().DistinctFor(inputs).Count()) .Select(count => $"There are {count} distinct expressions.") .WriteLinesTo(Console.Out);
static void PartitioningDemo() => InputNumberSequences .SelectMany(numbers => Partitionings.Of(numbers).All()) .Select(partitioning => partitioning.Select(partition => string.Join(" ", partition.ToArray()))) .Select(partitions => string.Join(" | ", partitions)) .WriteLinesTo(Console.Out);
static void GenerateProblems() => InputNumberSequences .SelectMany(UniqueExpressionsReport) .WriteLinesTo(Console.Out);