Category Theory via C# (22) More Monad: Continuation Monad
2018-12-23
In C#, callback is frequently used. For example, a very simple Add function, without asynchrony:
826 words
|
4 minutes
Category Theory via C# (21) More Monad: Writer< , > Monad
2018-12-22
Unlike the Reader< , > monad, the Writer< , > monad output contents with a sequence of functions:
709 words
|
4 minutes
Category Theory via C# (20) More Monad: Reader< , > Monad
2018-12-21
Sometimes there are functions work with a shared environment. Typical examples are:
601 words
|
3 minutes
Category Theory via C# (19) More Monad: State< , > Monad
2018-12-20
represents a abstract machine with one state or a number of state. C# use state machine a lot. For example:
1438 words
|
7 minutes
Category Theory via C# (18) More Monad: IO<> Monad
2018-12-19
As mentioned in a previous part, in purely functional programming, functions cannot have side effects. For example, when defining LINQ queries, laziness and purity are expected. So, how should the imp
1529 words
|
8 minutes
Category Theory via C# (17) Monad-like Tuple<>, Task<>, IQueryable<> And IQbservable<>
2018-12-18
Theoretically, Tuple<> should be counted as the Id<> monad. However, it is lack of laziness. In the context of C# and LINQ, it is only monad-like.
1400 words
|
7 minutes
Category Theory via C# (16) More Monads: Lazy<>, Func<>, Nullable<>, ParallelQuery<> And IObservale<>
2018-12-17
Again, Lazy<> is the simplest monad, it is just the lazy version of Tuple<>, and should be considered as the Id<> monad. This is the implementation of its SelectMany:
1561 words
|
8 minutes
Category Theory via C# (15) IEnumerable<> Monad And LINQ: SelectMany For All
2018-12-16
Previous part introduced SelectMany for monad IEnumerable<>. Actually SelectMany is more than meets the eye, and can be used to implement other LINQ queries.
2762 words
|
14 minutes