Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
F# 4.0 Design Patterns

You're reading from   F# 4.0 Design Patterns Solve complex problems with functional thinking

Arrow left icon
Product type Paperback
Published in Nov 2016
Publisher Packt
ISBN-13 9781785884726
Length 318 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Gene Belitski Gene Belitski
Author Profile Icon Gene Belitski
Gene Belitski
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Begin Thinking Functionally 2. Dissecting F# Origins and Design FREE CHAPTER 3. Basic Functions 4. Basic Pattern Matching 5. Algebraic Data Types 6. Sequences - The Core of Data Processing Patterns 7. Advanced Techniques: Functions Revisited 8. Data Crunching – Data Transformation Patterns 9. More Data Crunching 10. Type Augmentation and Generic Computations 11. F# Expert Techniques 12. F# and OOP Principles/Design Patterns 13. Troubleshooting Functional Code

Chapter 1. Begin Thinking Functionally

A man with a chainsaw enters a hardware shop and says to the assistant: "Two weeks ago, you told me this thing would allow me to chop down 30 trees in an hour. But I can only manage one tree. I want to return this for a refund". The assistant says "let me see" and starts the chainsaw. The visitor jumps back screaming "What's that noise?!"-An old joke

The joke opening my narrative is very relevant to the subject of this chapter: in order to achieve the benefits expected from the use of any tool, you should know how to use that tool the right way. Moreover, an advanced tool used in a wrong manner may be even less productive than the corresponding simple one used the right way. A hammer outperforms a microscope when it comes to nailing wooden boards together.

Chapter 1, Begin Thinking Functionally, should help you develop a manner of solving day-to-day software engineering problems that are usually associated with the functional paradigm. This means presenting the solution by verbs rather than nouns, avoiding the use of mutable entities to carry states, avoiding relying upon side-effects, and minimizing the amount of moving parts in the code.

In this chapter, we will cover the following topics:

  • The multi-paradigm nature of F#
  • A comparison of F# paradigms by solving the sample problem applying:
    • An imperative monolithic solution
    • An object-oriented solution
    • A functional solution
  • Properties of the functional paradigm

I will wrap up this chapter with a list of key concepts to retain and recognize, as well as skills to reuse in your functional solutions.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image