Functional Programming in C#
Functional Programming in C#
$10.00
Minimum price
$10.00
Suggested price
 Functional Programming in C#

This book is 95% complete

Last updated on 2020-02-03

About the Book

Note: This is not an Introductory book in C#. The reader must have at least a couple of years of C# experience. Please read the Sample pdf to get an idea about the content of the book

Book Description

   This book goes beyond the introductory ideas of functional programming, while progressively building on practical examples in a comprehensive manner. Each example is accompanied by online autonomous .NET Fiddle [ https://dotnetfiddle.net/Authors/127896] which you can run fork and modify, in order to deepen your understanding of each section. [GitHub repository: FunctionalCSharpWithCategories]

By the end of this book, you will have a deep understanding of the ideas behind functional C# that will allow you to program in a functional style with confidence. Also, you will have an overview of how famous functional libraries have implemented different functional concepts.

What you will learn:

  1.    Go beyond the List.Select by understanding how to generalize the idea of map to Functors like Maybe, Either and Task<T>, etc.
  2.    Go beyond the idea of List.Aggregate by understanding the concepts of fold and catamorphism over data structures.
  3.    Learn how to combine functional ideas in order to solve practical problems.
  4.    Use Monads like Maybe, Either, IO, and Task to chain computations.
  5.    Get a deep understanding of recursive methods and learn how to define recursive methods on algebraic data structures.

About the Author

dimitris papadimitriou
dimitris papadimitriou

I have more than 12 years’ experience as full stack developer and Architect.

I Like to stay in touch with all the latest developments in the field, as well as the foundational Theoretical Computer science and algorithm Analysis and Design

https://www.fluidinfunctional.com/

https://www.linkedin.com/in/dimitrispapadimitriou/

Packages

The Book
  • English

  • PDF

$10.00
Minimum price
$10.00
Suggested price
Book and Video Lectures

This is a Package containing the Book + Video Lectures Covering the Functors and Monads Chapters of this Book + The Source Code for the Course

Includes:

  • extras
    video lectures

    Those are the video lectures covering the Chapters of Functors and Monads of this book

  • extras
    Source Code for Video Lectures Course

    This is the Source Code of the Video Course

  • extras
    Course Free Coupon

    Those are the Video lectures in a LeanPub Course format.

  • English

  • PDF

$20.00
Minimum price
$20.00
Suggested price

Bundles that include this book

Functional Programming in Javascript
 Functional Programming in C#
$20.00
Suggested Price
$15.00
Bundle Price

Table of Contents

  • 2 Algebras of Programming
    • 2.1 Categories ... 8
    • 2.2 Monoids ... 10
    • 2.2.1 Folding monoids ... 13
    • 2.2.2 Monoid homomorphisms and Parallelism ... 14
  • 3 Algebraic Data Types
    • 3.1 The product structure: ... 19
    • 3.1.1 Introduction / Elimination ... 20
    • 3.2 The Co-Product (aka Union) structure ... 21
    • 3.2.1 Introduction / Elimination ... 22
    • 3.3 Extending Union Types ... 23
    • 3.3.1 Adding Pattern Matching extensions to Union Types ... 23
    • 3.3.2 Rewriting Union Type methods with MatchWith ... 24
    • 3.4 One ... 25
    • 3.5 Recursive Algebraic Types ... 26
    • 3.5.1 Rewriting Map with MatchWith ... 27
    • 3.5.2 On the value of the symbolic representation ... 27
    • 3.5.3 Adding Pattern Matching extension to Native List ... 28
  • 4 Functors
    • 4.1 The Identity Functor ... 32
    • 4.2 Commutative Diagrams ... 34
    • 4.3 The Functor Laws ... 34
    • 4.4 A brief mentioning of Catamorphisms ... 36
    • 4.5 Id Functor on the Fly ... 37
    • 4.5.1 Some more Isomorphisms ... 38
    • 4.6 Extending Task to Functor ... 39
    • 4.7 IO Functor, a Lazy Id Functor ... 41
    • 4.7.1 Lazy as Functor ... 41
    • 4.7.2 Func Delegates as Functor ... 42
    • 4.7.3 IO Functor ... 42
    • 4.8 Reader Functor ... 43
    • 4.9 LINQ Native Query syntax: Functor Support ... 44
    • 4.10 Maybe Functor ... 45
    • 4.10.1 The Null Object Design pattern ... 45
    • 4.10.2 Extending Nullable ... 47
    • 4.10.3 The Functional equivalent - Maybe as Functor ... 47
    • 4.11 Either Functor ... 50
    • 4.11.1 Using Either for exception handling ... 52
    • 4.11.2 Either and the Task functor ... 55
    • 4.12 Functors from Algebraic Data Types ... 57
    • 4.13 Explicitly Compositing Functor ... 60
    • 4.14 Applicative Functor ... 62
    • 4.15 Reader Applicative Functor ... 63
  • 5 Catamorphisms Again
    • 5.1 A brief mentioning of F-algebras ... 65
    • 5.2 Catamorphisms ... 66
    • 5.3 Initial algebra ... 67
    • 5.3.1 F-Algebras Homomorhisms ... 68
    • 5.4 Catamorphisms for Trees ... 69
    • 5.5 Catamorphisms with the Visitor Design pattern ... 71
    • 5.5.1 The Base Functor of the List ... 72
    • 5.5.2 A brief mentioning of Anamorhisms ... 75
    • 5.5.3 F-Coalgebra ... 77
    • 5.5.4 Corecursion ... 77
    • 5.5.5 A brief mentioning of Hylomorphisms ... 78
    • 5.5.6 Hylomorphism example: Mergesort ... 80
    • 5.6 Fold’s relation to Cata ... 81
  • 6 Traversable
    • 6.1 Traversable Array with Either applicative for validation ... 85
    • 6.2 Traversable Algebraic data structures ... 86
    • 6.3 Traversing with The Task aka Parallel ... 87
    • 6.4 Applicative Reader Isomorphism with the Interpreter Design pattern ... 89
    • 6.4.1 Standard Catamorphism implementation ... 90
    • 6.4.2 Reader applicative implementation ... 91
    • 6.4.3 Object Oriented Interpreter Pattern implementation ... 92
    • 6.5 Explicitly Composing Traversables ... 93
    • 6.6 Foldable ... 94
    • 6.6.1 FoldMap ... 95
    • 6.6.2 Explicitly Composing Foldables ... 97

Authors have earned$8,951,228writing, publishing and selling on Leanpub,
earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub