Functional Programming and LINQ via C#

[Latest version: https://weblogs.asp.net/dixin/linq-via-csharp]

Keywords

C#, .NET Core, Azure, Functional Programming, Lambda Calculus, Category Theory, LINQ, LINQ to Objects, LINQ to XML, Parallel LINQ, LINQ to Entities, Entity Framework Core, Azure SQL Database.

Abstract

This is a latest, in-depth, cross-platform book on functional programming and LINQ programming via C# language. It discusses:

  • Elegant functional programming via C#
  • Use functional LINQ to work with local data, and cloud data in Azure SQL Database
  • The internal implementation and underlying mathematics theories

    Contents at a Glance

    The contents are organized as the following chapters:

    • Part 1 Code - covers functional programming via C#, and fundamentals of LINQ.
      • Chapter 1 Functional programming and LINQ paradigm
        • What is LINQ, how LINQ uses language to work with many different data domains.
        • Programming paradigm, imperative vs. declarative programming, object-oriented vs. functional programming.
      • Chapter 2 Functional programming in depth
        • C# fundamentals for beginners.
        • Aspects of functional programming via C#, including function type, named/anonymous/local function, closure, lambda, higher-order function, currying, partial application, first class function, function composition, query expression, covariance/contravariance, immutability, tuple, purity, async function, pattern matching, etc., including how C# is processed at compile time and runtime.
    • Part 2 Data - covers how to use functional LINQ to work with different data domains in the real world, and how LINQ works internally.
      • Chapter 3 LINQ to Objects
        • How to use functional LINQ queries to work with objects, covering all LINQ and Ix.
        • How the LINQ to Objects query methods are implemented, how to implement useful custom LINQ queries.
      • Chapter 4 LINQ to XML
        • How to modeling XML data, and use functional LINQ queries to work with XML data.
        • How to use the other LINQ to XML APIs to manipulate XML data.
      • Chapter 5 Parallel LINQ
        • How to use parallelized functional LINQ queries to work with objects.
        • Performance analysis for parallel/sequential LINQ queries.
      • Chapter 6 Entity Framework/Core and LINQ to Entities
        • How to model database with object-relational mapping, and use functional LINQ queries to work with relational data in database.
        • How the C# LINQ to Entities queries are implemented to work with database.
        • How to change data in database, and handle concurrent conflicts.
        • Performance tips and asynchrony.
    • Part 3 Theories - demystifies the abstract mathematics theories, which are the rationale and foundations of LINQ and functional programming.
      • Chapter 7 Lambda Calculus via C#
        • Core concepts of lambda calculus, bound and free variables, reduction (α-conversion, β-reduction, η-conversion), etc.
        • How to use lambda functions to represent values, data structures and computation, including Church Boolean, Church numbers, Church pair, Church list, and their operations.
        • Combinators and combinatory logic, including SKI combinator calculus, fixed point combinator for function recursion, etc.
      • Chapter 8 Category Theory via C#
        • Core concepts of category theory, including category, object, morphism, monoid, functor, natural transformation, applicative functor, monad, and their laws.
        • How these concepts are applied in functional programming and LINQ.
        • How to manage I/O, state, exception handling, shared environment, logging, and continuation, etc., in functional programming.

    This tutorial delivers highly reusable knowledge:

    • It covers C# language in depth, which can be generally applied in any programming paradigms besides functional programming.
    • It is a cross platform tutorial, covering both .NET Framework for Windows and .NET Core for Windows, Mac, Linux.
    • It demonstrates both usage and implementation of LINQ for mainstream data domains, which also enables developer to use the LINQ technologies for other data domains, or build custom LINQ APIs for specific data scenarios.
    • It also demystifies the abstract mathematics knowledge for functional programming, which applies to general functional programming, so it greatly helps developers understanding any other functional languages too.

    As a fun of functional programming, LINQ, C#, and .NET technologies, hope this helps.

    Table of Contents

    All code examples are available on GitHub: https://github.com/Dixin/CodeSnippets.

    1. Functional programming and LINQ paradigm

      1. Getting started with .NET/Core, C# and LINQ

        • Cross platform .NET, C# and LINQ
          • .NET Framework
          • Parallel LINQ
          • .NET Core, UWP, Mono, Xamarin and Unity
          • .NET Standard
          • C# functional programming
        • This tutorial
        • Author
        • Code examples
        • Start coding
          • Start coding with Visual Studio (Windows)
          • Start coding with Visual Studio Code (Windows, macOS and Linux)
          • Start coding with Visual Studio for Mac (macOS)
      2. Programming paradigms and functional programming

        • Programming paradigms
        • Imperative programming vs. declarative programming
        • Object-oriented programming vs. functional programming
      3. LINQ Overview

        • One language for different data domains
          • LINQ to Objects
          • Parallel LINQ
          • LINQ to XML
          • LINQ to DataSets
          • LINQ to Entities
          • LINQ to SQL
          • LINQ to NoSQL (LINQ to CosmosDB)
          • LINQ to JSON
          • LINQ to Twitter
        • Productivity
        • Local query vs. remote query
    2. Functional programming in-depth

      1. C# language fundamentals

        • Types and members
          • Built-in types
        • Reference type vs. value type
          • default literal expression
          • ref structure
        • Static class
        • Partial type
        • Interface and implementation
          • IDisposable interface and using statement
        • Generic type
          • Type parameter
          • Type parameter constraints
        • Nullable value type
        • Auto property
        • Property initializer
        • Object initializer
        • Collection initializer
        • Index initializer
        • Null coalescing operator
        • Null conditional operator
        • throw expression
        • Exception filter
        • String interpolation
        • nameof operator
        • Digit separator and leading underscore
      2. Named Function and function polymorphism

        • Constructor, static constructor and finalizer
        • Static method and instance method
        • Extension method
        • More named functions
        • Function polymorphisms
          • Ad hoc polymorphism: method overload
          • Parametric polymorphism: generic method
            • Type argument inference
        • Static import
        • Partial method
      3. Local function and closure

        • Local function
        • Closure
          • Outer variable
          • Implicit reference
      4. Function input and output

        • Pass by value vs. pass by reference (ref parameter)
          • Pass by read only reference (in parameter)
        • Output parameter (out parameter) and out variable
        • Parameter array
        • Positional argument vs. named argument
        • Required parameter vs. optional parameter
        • Caller information parameter
        • Return by value vs. return by reference
          • Return by read only reference
      5. Delegate: function type, instance, and group

        • Delegate type as function type
          • Function type
          • Generic delegate type
          • Unified built-in delegate types
        • Delegate instance as function instance
          • Delegate class and delegate instance
        • Delegate instance as function group
          • Event and event handler
      6. Anonymous function and lambda expression

        • Anonymous method
        • Lambda expression
        • Call anonymous function
        • Closure
        • Expression bodied function member
      7. Expression tree: Function as data

        • Lambda expression as expression tree
          • Code as data
          • .NET expressions
        • Compile expression tree at runtime
          • Traverse expression tree
          • Expression tree to CIL at runtime
          • Expression tree to executable function at runtime
        • Expression tree and LINQ remote query
      8. Higher-order function, currying and first class function

        • First order and higher-order function
        • Curry function
        • => associativity
        • Partial apply function
        • Uncurry function
        • First-class function
      9. Function composition and chaining

        • Forward and backward composition
        • Forward pipe
        • Fluent chaining
          • Fluent extension methods
        • LINQ query method composition
      10. LINQ query Expression

        • Syntax and compilation
        • Query expression pattern
        • LINQ query expression
        • Query expression vs. query method
      11. Covariance and contravariance

        • Non-generic function type
        • Generic function type
        • Generic interface
        • Generic higher-order function type
        • Array
        • Variances in .NET and LINQ
      12. Immutability, anonymous type and tuple

        • Immutable value
          • Constant
          • using statement and foreach statement
          • this reference for class
          • Function’s readonly parameter and readonly return
          • Local variable by readonly reference (ref readonly variable)
          • Immutable value in LINQ query expression
        • Immutable state (immutable data type)
          • Type with constant field
          • Immutable class with readonly instance field
          • Immutable structure (readonly structure)
          • Immutable anonymous type
          • Immutable tuple vs. mutable tuple
            • Construction and element name
            • Deconstruction
            • Tuple assignment
          • Immutable collection vs. readonly collection
      13. Pure function

        • Referential transparency and side effect free
        • PureAttribute and code contracts
        • Purity in .NET
      14. Asynchronous function

        • Task, Task<TResult> and asynchrony
        • Named async function
        • Awaitable-awaiter pattern
        • Async state machine
        • Generalized async return type and async method builder
          • ValueTask<TResult> and performance
        • Runtime context capture
        • Anonymous async function
      15. Pattern matching

        • Is expression
        • Switch statement
    3. LINQ to Objects: Querying objects in memory

      1. Local Sequential LINQ query

        • Iteration pattern and foreach statement
        • IEnumerable<T> and IEnumerator<T>
          • EnumerableAssert utility
          • foreach loop vs. for loop
          • Non-generic sequence vs. generic sequence
        • LINQ to Objects queryable types
      2. LINQ to Objects standard queries and query expressions

        • Return a new IEnumerable<T> sequence
          • Generation: Empty , Range, Repeat, DefaultIfEmpty
          • Filtering (restriction): Where, OfType, where
          • Mapping (projection): Select, SelectMany, from, let, select
          • Grouping: GroupBy, group, by, into
          • Join
            • Inner join: Join, SelectMany, join, on, equals
            • Outer join: GroupJoin, join, into, on, equals
            • Cross join: SelectMany, Join, from select, join, on, equals
          • Concatenation: Concat
          • Set: Distinct, Union, Intersect, Except
          • Convolution: Zip
          • Partitioning: Take, Skip, TakeWhile, SkipWhile
          • Ordering: OrderBy, ThenBy, OrderByDescending, ThenByDescending, Reverse, orderby, ascending, descending, into
          • Conversion: Cast, AsEnumerable
        • Return a new collection
          • Conversion: ToArray, ToList, ToDictionary, ToLookup
        • Return a single value
          • Element: First, FirstOrDefault, Last, LastOrDefault, ElementAt, ElementAtOrDefault, Single, SingleOrDefault
          • Aggregation: Aggregate, Count, LongCount, Min, Max, Sum, Average
          • Quantifier: All, Any, Contains
          • Equality: SequenceEqual
        • Queries in other languages
      3. Generator

        • Implement iterator pattern
        • Generate sequence and iterator
        • Yield statement and generator
        • Iterator and generator in other languages
      4. Deferred execution, lazy evaluation and eager Evaluation

        • Deferred execution vs. immediate execution
          • Cold IEnumerable<T> vs. hot IEnumerable<T>
        • Lazy evaluation vs. eager evaluation
      5. LINQ to Objects internals: Standard queries implementation

        • Argument check and deferred execution
        • Return a new collection
          • Conversion: ToArray, ToList, ToDictionary, ToLookup
        • Return a new IEnumerable<T> sequence
          • Conversion: Cast, AsEnumerable
          • Generation: Empty , Range, Repeat, DefaultIfEmpty
          • Filtering (restriction): Where, OfType
          • Mapping (projection): Select, SelectMany
          • Grouping: GroupBy
          • Join: SelectMany, Join, GroupJoin
          • Concatenation: Concat
          • Set: Distinct, Union, Intersect, Except
          • Convolution: Zip
          • Partitioning: Take, Skip, TakeWhile, SkipWhile
          • Ordering: OrderBy, ThenBy, OrderByDescending, ThenByDescending, Reverse
        • Return a single value
          • Element: First, FirstOrDefault, Last, LastOrDefault, ElementAt, ElementAtOrDefault, Single, SingleOrDefault
          • Aggregation: Aggregate, Count, LongCount, Min, Max, Sum, Average
          • Quantifier: All, Any, Contains
          • Equality: SequenceEqual
      6. Microsoft Interactive Extensions (Ix): More powerful queries

        • Returns a new IEnumerable<T> sequence
          • Generation: Defer, Create, Return, Repeat
          • Filtering: IgnoreElements, DistinctUntilChanged
          • Mapping: SelectMany, Scan, Expand
          • Concatenation: Concat, StartWith
          • Set: Distinct
          • Partitioning: TakeLast, SkipLast
          • Conversion: Hide
          • Buffering: Buffer, Share, Publish, Memoize
          • Exception: Throw, Catch, Finally, OnErrorResumeNext, Retry
          • Imperative: If, Case, Using, While, DoWhile, Generate, For
          • Iteration: Do
        • Returns void
          • Iteration: ForEach
        • Returns a single value
          • Aggregation: Min, Max, MinBy, MaxBy
          • Quantifiers: isEmpty
      7. Building custom queries

        • Returns a new IEnumerable<T> sequence (deferred execution)
          • Generation: Create, RandomInt32, RandomDouble, FromValue, FromValues, EmptyIfNull
          • Filtering: Timeout
          • Concatenation: Join, Append, Prepend, AppendTo, PrependTo
          • Partitioning: Subsequence
          • Exception: Catch, Retry
          • Comparison: OrderBy, OrderByDescending, ThenBy, ThenByDescending, GroupBy, Join, GroupJoin, Distinct, Union, Intersect, Except
          • List: Insert, Remove, RemoveAll, RemoveAt
        • Returns a new collection
          • Comparison: ToDictionary, ToLookup
        • Returns a single value
          • List: IndexOf, LastIndexOf
          • Aggregation: PercentileExclusive, PercentileInclusive, Percentile
          • Quantifiers: IsNullOrEmpty, IsNotNullOrEmpty
          • Comparison: Contains, SequenceEqual
        • Returns void
          • Iteration: ForEach
    4. LINQ to XML: Querying XML

      1. Modeling XML

        • Imperative vs. declarative paradigm
        • Types, conversions and operators
        • Read and deserialize XML
        • Serialize and write XML
        • Deferred construction
      2. LINQ to XML standard queries

        • Navigation
        • Ordering
        • Comparison
        • More useful queries
        • XPath
        • Generate XPath expression
      3. Manipulating XML

        • Clone
        • Add, replace, delete, update, and events
        • Annotation
        • Validate with XSD
        • Transform
    5. Parallel LINQ: Querying objects in parallel

      1. Parallel LINQ query and visualization

        • Parallel LINQ classes and methods
        • Parallel query vs. sequential query
        • Execute parallel query
        • Visualize parallel query execution
          • Install and configure Concurrency Visualizer
          • Visualize sequential and parallel LINQ queries
          • Visualize chaining query methods
      2. Parallel LINQ internals: data partitioning

        • Partitioning algorithms and load balancing
          • Range partitioning
          • Stripped partitioning
          • Hash partitioning
          • Chunk partitioning
        • Implement custom partitioner
          • Static partitioner
          • Dynamic partitioner
      3. Parallel LINQ standard queries

        • Query settings
          • Cancellation
          • Degree of parallelism
          • Execution mode
          • Merge the values
        • Ordering
          • Control the order
          • Order and correctness
          • Orderable partitioner
        • Aggregation
          • Commutativity, associativity and correctness
          • Partition and merge
      4. Parallel query performance

        • Sequential vs. parallel
        • CPU bound vs. IO bound
        • Summary
    6. Entity Framework/Core and LINQ to Entities: Querying relational data

      1. Remote LINQ query

        • Entity Framework and Entity Framework Core
        • SQL database
        • Remote query vs. local query
        • Function vs. expression tree
      2. Modeling database: Object-Relational Mapping

        • Data types
        • Database
          • Connection resiliency and execution strategy
        • Tables
        • Relationships
          • One-to-one
          • One-to-many
          • Many-to-many
        • Inheritance
        • Views
        • Stored procedures and functions
      3. Logging and tracing LINQ to Entities queries

        • Application side logging
        • Database side tracing with Extended Events
      4. LINQ to Entities standard queries

        • Return a new IQueryable<T> source
          • Generation: DefaultIfEmpty
          • Filtering (restriction): Where, OfType
          • Mapping (projection): Select
          • Grouping: GroupBy
          • Join
            • Inner join: Join, SelectMany, GroupJoin, Select
            • Outer join: GroupJoin, Select, SelectMany
            • Cross join and self join: SelectMany, Join
          • Concatenation: Concat
          • Set: Distinct, Union, Intersect, Except
          • Partitioning: Take, Skip
          • Ordering: OrderBy, ThenBy, OrderByDescending, ThenByDescending
          • Conversion: Cast, AsQueryable
        • Return a single value
          • Element: First, FirstOrDefault, Single, SingleOrDefault
          • Aggregation: Count, LongCount, Min, Max, Sum, Average
          • Quantifier: All, Any, Contains
      5. LINQ to Entities internals: Query translation implementation

        • Code to LINQ expression tree
          • IQueryable<T> and IQueryProvider
          • Queryable methods
          • Build LINQ to Entities abstract syntax tree
        • .NET expression tree to database expression tree
          • Database query abstract syntax tree
          • Compile LINQ expressions to database expressions
          • Compile LINQ query method calls
          • Compile .NET API calls
          • Remote API call vs. local API call
          • Compile database function call
        • Database expression tree to SQL
          • SQL generator and SQL command
          • Generate SQL from database expression tree
      6. Loading query data

        • Deferred execution
          • Iterator pattern
          • Lazy evaluation vs. eager evaluation
        • Explicit loading
        • Eager loading
        • Lazy loading
          • The N + 1 problem
          • Disable lazy loading
      7. Manipulating relational data: Data change and transaction

        • Repository pattern and unit of work pattern
        • Track entities and changes
          • Track entities
          • Track entity changes and property changes
          • Track relationship changes
          • Enable and disable tracking
        • Change data
          • Create
          • Update
          • Delete
        • Transaction
          • Transaction with connection resiliency and execution strategy
          • EF/Core transaction
          • ADO.NET transaction
          • Transaction scope
      8. Resolving optimistic concurrency

        • Detect concurrent conflicts
        • Resolve concurrent conflicts
          • Retain database values (database wins)
          • Overwrite database values (client wins)
          • Merge with database values
        • Save changes with concurrent conflict handling
      9. Performance

        • Initialization
          • Provider initialization
          • Database initialization
          • Mapping views initialization
        • Cache
          • Entity cache
          • LINQ query translation cache
          • SQL query plan cache
        • Asynchrony
          • Asynchronous data queries and data changes
          • Transactions and connection resiliency with asynchronous operations
          • Asynchronous concurrent conflicts
    7. Lambda Calculus via C#: The foundation of all functional programming

      1. Fundamentals - Closure, Currying and Partial Application

        • About lambda calculus (λ-calculus)
        • Closure
        • Currying and partial application
        • Uncurry
        • => associativity
      2. Fundamentals - Lambda Expression, Variables, Reductions

        • Lambda expression
        • Bound and free variables
        • Reductions
          • α-conversion / alpha-conversion
          • β-reduction / beta-reduction
          • η-conversion / eta-conversion
      3. Fundamentals - Function composition

        • Function composition
          • Built-in operator in other languages
        • Properties
          • Associativity
          • Unit
      4. Encoding Church Booleans

        • Church encoding
        • Church Booleans - True and False
        • Unit test
      5. Boolean Logic

        • And
        • Or
        • Not
        • Xor
        • Conversion between Church Boolean and System.Boolean
        • Unit Tests
      6. If Logic, And Reduction Strategies

        • The first If
        • Reduction strategies
          • Normal order
          • Applicative order
        • Make If lazy
        • Unit tests
      7. Encoding Church Numerals

        • Church numerals
        • C# Implementation - starting from 0
      8. Church Numeral Arithmetic

        • Increase
        • Add
        • Decrease and subtract
      9. Wrapping Church Numerals And Arithmetic

        • Non-generic wrapper for Numeral<T>, and Increase
        • Add
        • Decrease and Subtract
        • Multiply and Pow
        • Divide?
      10. Church Numeral Arithmetic Operators

        • Operators
        • Conversion between Church numeral (now _Numeral) and System.UInt32
        • Compare _Numeral and System.UInt32
      11. Predicates, And Divide

        • Predicates
        • Divide
      12. Church Numeral Comparison Operators

        • Church Numeral Comparison Operators
          • C# object equality
        • Unit tests
      13. Encoding Church Pairs (2-Tuples) and Generic Church Booleans

        • Church pair (2-tuple)
        • Generic Church Booleans
          • Back to Church Boolean - why not using generic Church Booleans from the beginning?
        • Currying and type inference
      14. Church Pair (2-Tuple) and Church Numeral Decrease

        • Shift a Church Pair (2-Tuple)
        • Decrease a Church numeral
        • Unit tests
      15. Encoding Church List with Church Pair, And Null

        • Church pair as a Church list node
        • Encoding Null, and IsNull predicate
        • Church Boolean as Null
        • The improved Next
        • Index
        • Unit tests
      16. Encoding Church List with 2 Church Pairs as a Node

        • IsNull and Null
        • Create, Value, and Next
        • Index
        • Unit tests
      17. Encoding Church List with Fold (Aggregate) Function

        • ListNode and wrapper
        • IsNull
        • Create, value and Next
        • Index
        • Unit tests
      18. Encoding Signed Number

        • Create Signed number from Church numeral
        • Format with 0
        • Arithmetic
        • Unit tests
      19. Church Encoding, And More

        • Summary of church encoding
          • Boolean
          • Numeral
          • Predicate
          • Pair (2-tuple)
          • List
          • Signed number
        • Encode, encode, and encode<
          • From signed number to complex integer and rational number
          • From rational number to real number and complex number
          • And much more
          /li>
      20. Combinators

        • I Combinator
        • BCKW combinators
        • ω combinator
        • SKI combinators
          • Boolean in SKI, and type issue
      21. SKI Combinator Calculus

        • I Combinator
        • BCKW combinators
        • ω combinator
        • Function composition
        • Booleans
        • Numerals
        • Unit tests
      22. Iota Combinator and Jot Combinators

        • Language with 1 element
        • Completeness
        • Unit tests
      23. Y Combinator, And Divide

        • Fix point
        • Fixed point combinator
        • Recursion
          • Example – Fibonacci
        • DivideBy
        • Unit tests
    8. Category Theory via C#: The essentials and design of LINQ

      1. Fundamentals - Category, Object And Morphism

        • Category and category laws
        • The .NET category and morphism
      2. Monoid

        • Monoid and monoid laws
        • C#/.NET monoids
          • Void and Unit monoids
          • More examples
        • Nullable<T> monoid
        • Unit tests
      3. Monoid as Category

        • One monoid, one category
        • Category laws, and unit tests
      4. Functor And IEnumerable<>

        • Functor and functor laws
        • C#/.NET functors
          • Endofunctor
          • Kind issue of C# language/CLR
          • The built-in IEnumerable<> functor
        • Functor pattern of LINQ
        • IEnumerable<>, functor laws, and unit tests
      5. More Functors: Lazy<>, Func<> And Nullable<>

        • Lazy<> functor
        • Func<> functor
          • Fun< , > functor
        • Nullable<> functor
        • Functor laws, laziness, and unit tests
      6. Functor-like Tuple<>, Task<> And IQueryable<>

        • Tuple<> is like a functor
          • Tuple< , > is also like a functor
        • Laziness vs. eagerness
        • Task<T> is like a functor too
        • Purity vs. impurity
          • Purity and category theory
          • Purity and .NET
        • Purity, laziness and LINQ
          • Functor vs. functor-like
        • IQueryable<> is also like a functor
        • Hot task vs. cold task, and unit tests
      7. Natural Transformation

        • Natural transformation
        • Natural transformations for LINQ
        • More LINQ to Monads
      8. Functor Category

        • Functor Category
        • Endofunctor category
        • Monoid laws for endofunctor category, and unit tests
      9. Bifunctor

        • Bifunctor
        • C#/.NET bifunctor
        • Unit tests
      10. Monoidal Category

        • Monoidal category
        • DotNet category is monoidal category
      11. Monoidal Functor And IEnumerable<>

        • Monoidal functor
        • C#/.NET lax monoidal endofunctors
        • IEnumerable<> monoidal functor
          • N-arity selector for functor
          • Binary vs. Apply
        • Monoidal functor and LINQ
        • Applicative functor
        • Applicative laws, and unit tests
      12. More Monoidal Functors: Lazy<>, Func<> And Nullable<>

        • Lazy<> monoidal functor
        • Func<> monoidal functor
        • Nullable<> monoidal functor
        • Unit tests
      13. Monoidal Functor-like Tuple<> And Task<>

        • Tuple<>: lack of laziness
        • Task<>: lack of purity
        • Unit tests
      14. Monad And IEnumerable<>

        • Monad and monad laws
        • C#/.NET monads
        • IEnumerable<> monad and SelectMany
          • IEnumerable<> monad (SelectMany) is monoid
          • IEnumerable<> monad (SelectMany) is monoidal functor
          • IEnumerable<> monad (SelectMany) is functor
        • Monad pattern of LINQ
        • Monad laws, and unit test
      15. IEnumerable<> Monad And LINQ: SelectMany For All

        • Query methods implemented by SelectMany
        • Query methods in LINQ syntax
        • Unit tests
      16. More Monads: Lazy<>, Func<>, Nullable<>, ParallelQuery<> And IObservale<>

        • Lazy<> monad
        • Func<> monad
        • Nullable<> monad
        • ParallelQuery<> monad
        • IObservable<>  monad
        • Unit tests
      17. Monad-like Tuple<>, Task<>, IQueryable<> And IQbservable<>

        • Tuple<>: lack of laziness
        • Task<>: lack of purity
          • Task<> and LINQ
          • Non-generic Task
        • IQueryable<> is like a monad
        • IQbservable<> is also like a monad
        • Unit tests
      18. More Monad: IO<> Monad

        • IO<T> and impurity
        • IO<> monad
        • Monad laws, and unit tests
      19. More Monad: State< , > Monad

        • C#/.NET state machines
        • State pattern in object-oriented programming
        • State<> monad
        • Monad laws, and unit tests
      20. More Monad: Reader< , > Monad

        • Reader< , > Monad
        • Monad laws, and unit tests
      21. More Monad: Writer< , > Monad

        • Writer< , > monad
        • Monad laws, and unit tests
      22. More Monad: Continuation Monad

        • Continuation and continuation-passing style
        • Continuation monad
        • Monad laws, and unit tests
      23. Performance

        • Functional and purely functional
        • Cost of functional and monad
        • Cost of lambda
        • Conclusion

    5 Comments

    Add a Comment

    As it will appear on the website

    Not displayed

    Your website