Dixin's Blog
Microsoft Most Valuable Professional (CodingOnWheels.com) & Photographer (PicturesOnWheels.com). Code examples: GitHub.com/Dixin/Blog.
-
Category Theory via C# (10) Monoidal Category
A previous part demonstrated endofunctor category is monoidal. Now with the help of bifunctor, the general abstract monoidal category can be defined. A monoidal category is a category C equipped with:
-
Category Theory via C# (9) Bifunctor
As discussed in all the previous functor parts, a functor is a wrapper of a object with a “Select” ability to preserve a morphism to another‘
-
Category Theory via C# (8) Functor Category
Given 2 categories C and D, functors C → D forms a functor category, denoted DC:
-
Category Theory via C# (7) Natural Transformation
If F: C -> D and G: C -> D are both functors from categories C to category D, a mapping can be constructed between F and G, called natural transformation and denoted η : F ⇒ G.
-
Category Theory via C# (6) Functor-like Tuple<>, Task<> And IQueryable<>
Tuple<> looks like the simplest functor by just wrapping a value. It is most close to the Identity functor of Haskell. Its Select functions are:
-
Category Theory via C# (5) More Functors: Lazy<>, Func<> And Nullable<>
A simple functor in DotNet category is Lazy<>. Its Select functions can be easily implemented:
-
Category Theory via C# (4) Functor And IEnumerable<>
A functor F: C → D is a structure-preserving mapping from category C to category D:
-
Category Theory via C# (3) Monoid as Category
An individual monoid (T, ⊙, I) can be a category M:
-
Category Theory via C# (2) Monoid
A monoid, denoted a 3-tuple (M, ⊙, I), is a set M with
-
Category Theory via C# (1) Fundamentals - Category, Object And Morphism
This post and the following posts will introduce category theory and its important concepts via C# and LINQ, including functor, applicative functor, monoid, monad, etc. Categories were first introduced by Samuel Eilenberg and Saunders Mac Lane in 1942–45. It might be tedious, as Wikipedia pointed:
-
Lambda Calculus via C# (23) Y Combinator, And Divide
p is the fixed point of function F if and only if:
-
Lambda Calculus via C# (22) Iota Combinator and Jot Combinators
Iota is an esoteric programming language with minimum elements but still Turing-complete. Iota's universal combinator is:
-
Lambda Calculus via C# (21) SKI Combinator Calculus
The previous part shows SKI calculus is untyped and strongly typed C# implementation does not work. So here comes the SKI in untyped C#:
-
Lambda Calculus via C# (20) Combinators
As mentioned in a fundamental part, combinator is a special kind of lambda expression without free variables. So combinatory logic (introduced by Moses Schönfinkel and Haskell Curry) can be viewed as a variant of lambda calculus.
-
Lambda Calculus via C# (19) Church Encoding, And More
So far a ton has been encoded. Here is a summary.
-
Lambda Calculus via C# (18) Encoding Signed Number
In lambda calculus, a signed number (integer) can be represented by a Church pair (2-tuple) of Church numerals (natural numbers):
-
Lambda Calculus via C# (17) Encoding Church List with Fold (Aggregate) Function
A third way to encode Church list, is to use fold function (also called aggregate in C#/.NET):
-
Lambda Calculus via C# (16) Encoding Church List with 2 Church Pairs as a Node
Previous part encoded Church list with one Church pair (2-tuple) as a list node. An alternative way is to use 2 tuples as a node, one wrapping the other.
-
Lambda Calculus via C# (15) Encoding Church List with Church Pair, And Null
This part will demonstrate how to use lambda expressions to encode another data structure - list (Church list in lambda calculus or LinkedList<T> in .NET).
-
Lambda Calculus via C# (14) Church Pair (2-Tuple) and Church Numeral Decrease
In the Church numeral arithmetic part, the Decrease was defined as: