Why just get by in F# when you can program in style! This book goes beyond syntax and into design. It provides F# developers with best practices, guidance, and advice to write beautiful, maintainable, and correct code.
Stylish F# covers every design decision that a developer makes in constructing F# programs, helping you make the most educated and valuable design choices at every stage of code development. You will learn about the design of types and function signatures, the benefits of immutability, and the uses of partial function application. You will understand best practices for writing APIs to be used by F#, C#, and other languages. Each carefully vetted design choice is supported with compelling examples, illustrations, and rationales.
What You'll Learn
Know why, when, and how to code in immutable style Use collection functions, piping, and function composition to build working software quickly Be aware of the techniques available to bring error handling into the mainstream of program logic
Optimize F# code for maximum performance
Identify and implement opportunities to use function injection to improve program design
Appreciate the methods available to handle unknown data values
Understand asynchronous and parallel programming in F#, and how it differs from C# asynchronous programming
Who This Book Is For
Any developer who writes F# code and wants to write it better
Works exactly as advertised. Must-read for intermediate F# developers that want to write more "idiomatic F#".
The book covers: * formatting your code for maximum legibility (TL;DR: use a formatter like fantomas) * Idiomatic F#: separate chapters on how to tackle asynchronous code, handling "missing data", "railway oriented programming", when to use record types vs. class types, pattern matching, immutability, collection functions, ... * introduction to benchmarking and performance tweaking of F# code
I thoroughly enjoyed working through this book. Every chapter has exercises (+ solutions) so you can play around with the content matter yourself and check your results.
The book illustrates good ways to program in functional programming paradigm using contrasting examples in F# -- mutable linear search vs immutable linear search, no ROP vs ROP. I liked this approach as it almost serves like a catalog of how to realize imperative programming coding patterns in functional programming. So, this book would be immensely helpful for folks coming to FP from IMP.
The only "downside" for the general FP audience is that it is F# specific. Also, while the author considers performance, I wish he went into more depth by considering how different use cases are realized in FP (e.g., filter-and-map) , how they can contribute to performance degradation (e.g., repeated checks or storage), and how to address these issues in FP-esque way (e.g., scoping, splicing operations). May be that's another book by itself :)
Having similar such a book that is language agnostic would be even more helpful.
Good book to start with F# as it give good insights to start with an FP mindset, however you may feel a bit lost with the language sintax if you are starting from zero, take a look in some sintax cheatsheet in parallel, and don't expect it to be an intermediate/advanced book or to go deep in pure FP, it is a beginners book.