Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
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 (20) Chapters Close

F# 4.0 Design Patterns
Credits
About the Author
Acknowledgements
About the Reviewer
www.PacktPub.com
Preface
1. Begin Thinking Functionally FREE CHAPTER 2. Dissecting F# Origins and Design 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

Operators as functions


What is an operator, thinking abstractly? It can be seen as a function of one or two arguments that just have a concise name represented by a single symbol or a very few symbols. F# heartily supports this abstraction. For example, take a look at the following expression:

(%) 10 3 = 10 % 3 

Here, on the left-hand side of the equality sign (=), the (%) function is called with the arguments 10 and 3. On the right-hand side of the equality sign (=) just a 10 % 3 expression is present. Evaluating the whole expression in FSI shows its value as true because sub expressions on the left and right of the equality sign (=) are indeed identical.

Furthermore, the equality sign (=) itself is also an operator. Evaluating the equality sign (=) itself in FSI with the following expression (=);; will reveal the following function signature:

('a -> 'a -> bool) when 'a : equality 

The preceding signature means that (=) is simply a function that takes two arguments of generic type 'a...

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 $15.99/month. Cancel anytime
Visually different images