SUMMARY

Handling of sequences in .NET is easy due to the native support for the lazy interfaces IEnumerable and IEnumerable<T>. The compiler offers special support for sequence generation since C# version 2.0, but the use of functional approaches still improves the syntax considerably. Unfortunately there’s no compiler support for “real” list comprehensions, so the syntax often remains a bit clumsy and there are limits for the applicability of sequence generation approaches.

Get Functional Programming in C#: Classic Programming Techniques for Modern Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.