Functional Programming in C#, Second Edition

  • 7h 29m
  • Enrico Buonanno
  • Manning Publications
  • 2021

Real world examples and practical techniques for functional programming in C# without the jargon and theory.

In Functional Programming in C#, Second Edition you will learn how to:

  • Use higher-order functions to reduce duplication and do more with less code
  • Use pure functions to write code that is easy to test and optimize
  • Write pleasant APIs that accurately describe your program's behavior
  • Use dedicated types to handle nullability, system errors, and validation rules predictably and elegantly
  • Write composable code without the overhead of an IoC container

Functional Programming in C# has helped thousands of developers apply functional thinking to C# code. Its practical examples and spot-on treatment of FP concepts makes it the perfect guide for proficient C# programmers. This second edition is fully revised to cover new functional-inspired features in the most recent releases of C#, including tuples, async streams, pattern matching, and records. Each chapter is packed with awesome perspectives and epiphany moments on how functional programming can change the way you code.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology

Turbocharge your C# code. Good functional techniques will improve concurrency, state management, event handling, and maintainability of your software. This book gives you practical answers to why, how, and where to add functional programing into your C# coding practice.

About the book

Functional Programming in C#, Second Edition teaches functional thinking for real-world problems. It reviews the C# language features that allow you to program functionally and through many practical examples shows the power of function composition, data-driven programming, and immutable data structures. All code examples work with .NET 6 and C# 10.

About the Author

Enrico Buonanno studied Computer Science at Columbia University and has over 15 years of experience as a developer, architect, and trainer.

In this Book

  • About This Book
  • Introducing Functional Programming
  • Thinking in Functions
  • Why Function Purity Matters
  • Designing Function Signatures and Types
  • Modeling the Possible Absence of Data
  • Patterns in Functional Programming
  • Designing Programs with Function Composition
  • Functional Error Handling
  • Structuring an Application with Functions
  • Working Effectively with Multi-Argument Functions
  • Representing State and Change
  • A Short Introduction to Functional Data Structures
  • Event Sourcing—A Functional Approach to Persistence
  • Lazy Computations, Continuations, and the Beauty of Monadic Composition
  • Stateful Programs and Stateful Computations
  • Working with Asynchronous Computations
  • Traversable and Stacked Monads
  • Data Streams and the Reactive Extensions
  • An Introduction to Message-Passing Concurrency
  • Epilogue. What Next?