Jump to ratings and reviews
Rate this book

Stylish F#: Crafting Elegant Functional Code for .NET and .NET Core

Rate this book
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

418 pages, Paperback

Published November 30, 2018

3 people are currently reading
27 people want to read

About the author

Kit Eason

5 books1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
10 (40%)
4 stars
9 (36%)
3 stars
5 (20%)
2 stars
0 (0%)
1 star
1 (4%)
Displaying 1 - 4 of 4 reviews
Profile Image for Jo.
39 reviews9 followers
November 2, 2021
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.
Profile Image for Venkatesh-Prasad.
223 reviews
March 5, 2019
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.
Profile Image for Felipe.
12 reviews
August 7, 2019
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.
Profile Image for Torben Koch.
27 reviews5 followers
January 16, 2019
The title is incorrect. It should be "Crafting Elegant Functional Code for .NET and .NET Core".

It is a book of varying quality, but there are some good take aways from it.

Go read it.
Displaying 1 - 4 of 4 reviews

Can't find what you're looking for?

Get help and learn more about the design.