Skip to content

An step by step introduction to functional programming in C#.

License

Notifications You must be signed in to change notification settings

adleatherwood/FunctionalPatternsForCleanerCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Functional Patterns for Cleaner Code

View it on repl.it

A related slide presentation can be found here.

The presentation covers various functional patterns that can be brought into the OOP paradigm with the goal of achieving code that is easier to understand, test, and maintain. Topics covered:

  • Nulls
  • Exceptions
  • The Law of Demeter
  • Indirect Input/Output

The code sample is a step-by-step take on Scott Wlaschin's Railway Oriented Programming example. The code has been rewritten several times in the following stages:

  • Imperative
  • Declarative
  • Using the Result data type
  • Using the Result as a monad
  • Using only Pure functions
  • Replacing interfaces with functions
  • A version in F# for kicks
Icons made by Freepik from www.flaticon.com

About

An step by step introduction to functional programming in C#.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published