Previous Thread
In the last functional thread we explored the following two FP algebras:
Algebras which provided us a solution to encapsulate our code in a data structure that internally employs Lazy Transformations without the requirement to modify any of our data types; more specifically data types that defer data transformations by compositing all the changes, and in providing a way to delay the compute until it is required.
YonedaCoyoneda
For reference, you can find that thread here:
https://mybroadband.co.za/forum/threads/functional-thread-7-lazy-transformations.1007038/
Monadic Computations
In functional programming, monadic computations are useful to encapsulate effectual style computations that need to produce an end result. More than that it provides a mechanism that allows us to structure our typically imperative style code more generically whilst also automating away the boilerplate code that typically encapsulates conditional programming.
In short, we will be exploring a few different ways that the
Monad algebra can be employed, and to briefly contrast this against the Functor and Applicative Functor algebras in terms of the versatility of each.Target Audience
This thread is targeted at intermediate developers; hence we'll be building on a few of the data types created in the FP thread 6, part 1 and part 2, for example:
Maybe,Either,- etc.
Note:
- This is going to be a fairly short thread, but it will include quite a bit of code.
- There again is no need to understand the mathematics behind this to use it and the implementations in C# will be relatively easy to understand without a maths background.
- We will also as a bonus be looking at how we can make our custom FP data types like
Maybe,Either, ... work alongside theLinqspecific syntax, for example:from x in xs
Last edited: