Dixin's Blog
Microsoft Most Valuable Professional (CodingOnWheels.com) & Photographer (PicturesOnWheels.com). Code examples: GitHub.com/Dixin/Blog.
-
Lambda Calculus via C# (13) Encoding Church Pairs (2-Tuples) and Generic Church Booleans
Church pair is the Church encoding of the pair type, aka 2-tuple. Unlike the Tuple<T1, T2> class in .NET, in lambda calculus Church pair will be represented by lambda expression. To avoid 2 naming systems, here in all the code, Church pair will be called tuple.
-
Lambda Calculus via C# (12) Church Numeral Comparison Operators
With the predicates defined in previous part, operators can be defined in _Numeral class. Once again, class does not exist in lambda calculus, but C# class provides a place to define operators, which greatly improve the readability.
-
Lambda Calculus via C# (11) Predicates, And Divide
A predicate is a function that returns a Boolean value. In Church encoding of lambda calculus, a predicate is a lambda expression that returns a Church Boolean.
-
Lambda Calculus via C# (10) Church Numeral Arithmetic Operators
Another benefits of introducing (cheating with) _Numeral class into lambda calculus is - it provides a place to define custom operators.
-
Lambda Calculus via C# (9) Wrapping Church Numerals And Arithmetic
In previous part, the Decrease function was a Func<Numeral<Func<Func<T, T>, T>>, Numeral<T>>:
-
Lambda Calculus via C# (8) Church Numeral Arithmetic
The previous part defined Church numerals in lambda calculus and implemented 0, 1, 2, 3 in 2 different ways. By observing the definition and code, there are some patterns when the Church numeral increases from 0 to 3.
-
Lambda Calculus via C# (7) Encoding Church Numerals
Previous parts showed that Boolean values, Boolean logic, and if logic can all be encoded by lambda expressions. This and next few articles will focus on natural numbers. Signed number will be encoded after introducing Church pairs (2-tuples).
-
Lambda Calculus via C# (6) If Logic, And Reduction Strategies
The if logic is already built in Church Booleans.
-
Lambda Calculus via C# (5) Boolean Logic
After defining Boolean values True and False with functions, now the Boolean logics can be encoded, by functions too.
-
Lambda Calculus via C# (4) Encoding Church Booleans
After clarifying the concepts and terms, a lot of implementation coding starts from this part.
-
Lambda Calculus via C# (3) Fundamentals - Function composition
It may not be the best place to discuss function composition in the lambda calculus series. However, function composition will be used a lot in later articles, so here is a brief introduction.
-
Lambda Calculus via C# (2) Fundamentals - Lambda Expression, Variables, Reductions
The C# lambda expression has been discussed in detail. This post will explain lambda expression and other concepts in lambda calculus.
-
Lambda Calculus via C# (1) Fundamentals - Closure, Currying and Partial Application
C# lambda expression is discussed in detail used everywhere in the LINQ via C# series. This post and the following few posts will focus on functions and disregard lambda expression for expression tree. These articles will be a deeper dive about lambda expression and lambda calculus - how it comes, what it does, and why it matters. And - functions and anonymous functions will always be the only primitive.
-
Entity Framework Core and LINQ to Entities (9) Performance
The previous parts has discussed some aspects that can impact the performance of EF/Core and LINQ to Entities, and here is a summary:
-
Parallel LINQ in Depth (4) Performance
Parallel LINQ is powerful, but also can be more complex. This part discusses Parallel LINQ query performance in different cases.
-
Parallel LINQ in Depth (3) Query Methods (Operators)
Parallel LINQ provides additional query methods and additional overrides for Aggregate method:
-
Parallel LINQ in Depth (2) Partitioning
The first step of Parallel LINQ is partitioning. The source values is split into several partitions, so that multiple threads can execute the query logic in parallel.
-
Parallel LINQ in Depth (1) Local Parallel Query and Visualization
So far, all the discussion for LINQ to Objects/XML does not involve multi-threading, concurrency, or parallel computing. This is by design, because pulling values from an IEnumerable<T> sequence is not thread-safe.When multiple threads simultaneously access one IEnumerable<T> sequence, race condition can occur and lead to unpredictable consequence. As a result, all the LINQ to Objects/XML queries are implemented in a sequential manner with a single thread. To scale LINQ in multi-processor environment, Since .NET Framework4.0, a parallel version of LINQ to Objects is also provided, called Parallel LINQ or PLINQ.
-
LINQ to XML in Depth (3) Manipulating XML
Besides creating and querying XML, LINQ to XML also provides APIs for other XML manipulations, including cloning, deleting, replacing, and updating XML structures:
-
LINQ to XML in Depth (2) Query Methods (Operators)
As fore mentioned, LINQ to XML is just a specialized LINQ to Objects, so all the LINQ to Objects query methods can be used in LINQ to XML queries. LINQ to XML provides many function members and other methods for XML tree navigation, ordering, XPath querying, etc. The following list shows these functions and their return types: