Functional function concepts
Course Content
0 / 61 completedHow to access the sample code on GitHub
What you should know
Functional programming patterns
Don't be making side effects
What is functional programming
Core principles of functional programming
Monads, currying and other terms
The functional parts of C#
Function categories
Write pure functions for better code
Example of an impure function
Refactor impure function to pure
Don't mutate input arguments
Use an immutable argument
Reduce code side effects
What about impure class properties
Refactor side effect example
Work with files
Filter with LINQ Where
Calculate the total in a pure function
Functional function concepts
Use FuncT for first class functions
Higher-order LINQ
Higher-order filter example
Higher-order transform example
Return function from function call
Simple immutable example
More principles
Principles of immutable types
Read-only properties
Instance method in immutable type
Use factory method to create instance
Use helper methods to create new instance
Why expressions are better for functional programs
Some examples of C# expressions
Rewrite IF statement with expression
Rewrite SWITCH statement with expression
Rewrite FOREACH with expression
IsPrime function as an expression
Learn the composition patterns
Compose functions
Pipelining with extension methods
Pipelining with generic methods
Pipelining with IEnumerable
Understand Map and other concepts
Map with LINQ SELECT
Map to a different type
Join with SelectMany
Filter with LINQ WHERE
Flatten with SelectMany
Fold with SUM and AGGREGATE
Randomness in functional programming
A functional Random class
Extension methods for various types
Specify a smaller range of random numbers
Randomize the order of a list
Create a random list
Replace VOID with the UNIT class
Replace NULL with OPTION
Explore the Either type for error handling
Next steps