Functional Programming in C#, Second Edition, Video Edition

Functional Programming in C#, Second Edition, Video Edition

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 12h 41m | 1.78 GB

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.

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.

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.

What’s inside

  • Higher-order functions reduce duplication and do more with less code
  • Code based on pure functions is easy to test and optimize
  • Write pleasant APIs that accurately describe your program’s behavior
  • Write a Web API in a functional style
  • Monadic composition with LINQ
Table of Contents

How functional a language is C
Introducing functional programming
Summary
What you will learn in this book
Higher-order functions (HOFs)
Summary
Thinking in functions
Using HOFs to avoid duplication
Enabling parallelization by avoiding state mutation
Purity and testability
Purity and the evolution of computing
Summary
Testing code that performs IO
Why function purity matters
Capturing data with data objects
Designing function signatures and types
Modeling the absence of data with Unit
Summary
An introduction to the Option type
Dealing with null
Implementing Option
Modeling the possible absence of data
Option as the natural result type of partial functions
Summary
Chaining functions with Bind
Coding at different levels of abstraction
Combining Option and IEnumerable with Bind
Filtering values with Where
Patterns in functional programming
Performing side effects with ForEach
Summary
An end-to-end server-side workflow
An introduction to functional domain modeling
Designing programs with function composition
Programming workflows
Summary
Thinking in terms of data flow
Chaining operations that may fail
Functional error handling
Representing outcomes to client applications
Summary
Validation A perfect use case for Either
Variations on the Either theme
Creating a partial-application-friendly API
Curried functions Optimized for partial application
Modularizing and composing an application
Overcoming the quirks of method resolution
Reducing a list to a single value
Structuring an application with functions
Summary
Functors, applicatives, and monads
Improving readability by using LINQ with any monad
Summary
The monad laws
When to use Bind vs. Apply
Working effectively with multi-argument functions
Representing state and change
Separating data and logic
Summary
Understanding state, identity, and change
Using records to capture the state of domain entities
A short introduction to functional data structures
Binary trees
In conclusion
Summary
Architecture of an event-sourced system
Comparing different approaches to immutable storage
Event sourcing A functional approach to persistence
Event sourcing basics
Summary
Creating a middleware pipeline for DB access
Exception handling with Try
Lazy computations, continuations, and the beauty of monadic composition
Summary
A general pattern for stateful computations
A language for generating random data
Stateful programs and stateful computations
Summary
Async streams
Summary
Working with asynchronous computations
Combining asynchrony and validation (or any other two monadic effects)
Summary
Traversable and stacked monads
Creating IObservables
Data streams and the Reactive Extensions
Implementing logic that spans multiple events
Summary
Transforming and combining data streams
When should you use IObservable
Functional APIs, agent-based implementations
Message-passing concurrency in LOB applications
Summary
Understanding message-passing concurrency
An introduction to message-passing concurrency
Epilogue. What next
Part 1. Getting started
Part 2. Core techniques
Part 3. Functional designs
Part 4. Advanced techniques
In conclusion
Pattern matching before C 8
Revisiting the event sourcing example
Working with previous version of C

Homepage