Preface
Following design patterns is a well-known approach to writing better programs that captures and reuses the high-level abstractions that are common in many applications. This book will encourage you to develop an idiomatic F# coding skillset by fully embracing the functional-first F# paradigm. It will also help you harness this powerful instrument to write succinct, bug-free, and cross-platform code.
F# 4.0 Design Patterns will start off by helping you develop a functional way of thinking. We will show you how beneficial the functional-first paradigm is and how to use it to get the optimum results. The book will help you acquire the practical knowledge of the main functional design patterns, relationship of which with the traditional “Gang of Four” set is not straightforward.
We will take you through pattern matching, immutable data types, and sequences in F#. We will also uncover advanced functional patterns, look at polymorphic functions, see typical data crunching techniques, and learn adjusting code through augmentation and generalization. Lastly, we take a look at the advanced techniques to equip you with everything you may need to write flawless code. In addition, we will explore how the paradigm shift to functional-first affects the design principles and patterns of the object-oriented universe and wrap up the book with specifics of functional code troubleshooting.
By reading this book you will achieve the following goals:
- Acquire the practical knowledge to use the main functional design patterns
- Realign some imperative and object-oriented principles under the functional approach
- Develop your confidence in building and combining first-order and higher-order functions
- Learn how to use core language pattern matching effectively
- Learn how to use embedded algebraic data types in place of custom types for added effectiveness and code succinctness
- Navigate and use F# core libraries with ease by seeing patterns behind specific library functions
- Recognize and measure the difference in resource consumption between sequences and materialized data structures
- Master writing generic polymorphic code