Learn more
These promotions will be applied to this item:
Some promotions may be combined; others are not eligible to be combined with other offers. For details, please see the Terms & Conditions associated with these promotions.
Your Memberships & Subscriptions
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Hands-On Functional Programming in Rust: Build modular and reactive applications with functional programming techniques in Rust 2018 Kindle Edition
Explore the support Rust offers for creating functional applications in Rust. Learn about various design patterns, implementing concurrency, metaprogramming, and so on in the process
Key Features
- Learn generics, organization, and design patterns in functional programming
- Modularize your applications and make them highly reusable and testable using functional design patterns
- Get familiar with complex concepts such as metaprogramming, concurrency, and immutability
Book Description
Functional programming allows developers to divide programs into smaller, reusable components that ease the creation, testing, and maintenance of software as a whole. Combined with the power of Rust, you can develop robust and scalable applications that fulfill modern day software requirements. This book will help you discover all the Rust features that can be used to build software in a functional way.
We begin with a brief comparison of the functional and object-oriented approach to different problems and patterns. We then quickly look at the patterns of control flow, data the abstractions of these unique to functional programming. The next part covers how to create functional apps in Rust; mutability and ownership, which are exclusive to Rust, are also discussed. Pure functions are examined next and you'll master closures, their various types, and currying. We also look at implementing concurrency through functional design principles and metaprogramming using macros. Finally, we look at best practices for debugging and optimization.
By the end of the book, you will be familiar with the functional approach of programming and will be able to use these techniques on a daily basis.
What you will learn
- How Rust supports the use of basic functional programming principles
- Use functional programming to handle concurrency with elegance
- Read and interpret complex type signatures for types and functions
- Implement powerful abstractions using meta programming in Rust
- Create quality code formulaically using Rust's functional design patterns
- Master Rust's complex ownership mechanisms particularly for mutability
Who this book is for
This book is for Rust developers who are comfortable with the language and now want to improve their coding abilities by learning advanced functional techniques to enhance their skillset and create robust and testable apps.
Table of Contents
- Functional Programming - a comparison
- Functional Control Flow
- Functional Data Structures
- Generics and Polymorphism
- Code Organization and Application Architecture
- Mutability, Ownership, and Pure Functions
- Design Patterns
- Implementing Concurrency
- Metaprogramming,Debugging, and Performance
- LanguageEnglish
- PublisherPackt Publishing
- Publication dateMay 31, 2018
- File size3.3 MB
Customers who read this book also read
Editorial Reviews
About the Author
Andrew Johnson is an avid supporter of all things functional. Rust is currently his favorite language and he will not hesitate to lecture anyone about its benefits. Andrew is also interested in compiler design, with a focus on making languages simultaneously more efficient to run, but also easier to program.
Product details
- ASIN : B07C5S4729
- Publisher : Packt Publishing
- Accessibility : Learn more
- Publication date : May 31, 2018
- Edition : 1st
- Language : English
- File size : 3.3 MB
- Screen Reader : Supported
- Enhanced typesetting : Enabled
- X-Ray : Not Enabled
- Word Wise : Not Enabled
- Print length : 566 pages
- ISBN-13 : 978-1788831581
- Page Flip : Enabled
- Best Sellers Rank: #2,366,011 in Kindle Store (See Top 100 in Kindle Store)
- #172 in Functional Software Programming
- #592 in C++ Programming Language
- #724 in Algorithm Programming
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read book recommendations and more.
Products related to this item
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews. Please reload the page.
- Reviewed in the United States on May 10, 2020There is a certain style you can almost expect with language books with titles this broad, but this particular book was written on an intermediate level to focus of introducing FP concepts to an existing Rust knowledge, where all of the general concepts of Rust are assumed common knowledge (See page 3: to get the most out of this book). Instead of the book being written around some larger project (a common practice when teaching general language concepts), this book has instead been written as a collection of common practices and patterns which apply to the FP paradigm within Rust. While you cannot expect to read the code examples and write them as working projects, the book does offer a repository of working examples for each concept discussed, so you can still pick it apart and experiment, or simply see how it's used.
As someone who was not a stranger to FP programming in other languages, nor writing simple Rust apps, I found this book to be absolutely ideal for my needs. I was only ever interested in how apply FP idioms and patterns, while seeing how constructs behaved in different scenarios of meta-programming. Not having to deal with the bloat that would come from teaching general concepts, made for a much shorter read. I'm not sure if this niche was intended, but If you share the same use-case, I highly recommend this book.
- Reviewed in the United States on June 6, 2019I've started this book twice now and just can't get passed 30% or so (on my Kindle). I've been doing Rust for about three years now and have been wanting to get into functional programming; so I got this book. The first bit of the book makes it sound hopeful, but then tries to dig in to content using chapters worth of working through some example "project". ...which could be fine, but much of that is spent talking about project management ideas (which in 20 years of software development are not familiar ones to me at that) and the science behind that project (pages and pages of controller software for an elevator in a building, so how to calculate acceleration, velocity, etc). If there have been FP concepts introduced, they've been lost in all of this unrelated content, leaving me frustrated with this book.
- Reviewed in the United States on March 17, 2021I was really hoping this book would shine some light on best practices with employing functional programming methods in Rust, but I ended up spending most of my time trying to wrap my head around dense code and terse explainations. I had to give up half way through as I just couldn't justify the remaining time investment when the first half brought me no value.
I've bought several Packt publishing books and while I do appreciate their willingness to push out titles of bleeding edge topics ahead of other publications, it often comes as the cost of quality.
I believe the author made a valiant effort to pull together some material relating to functional programming in Rust. However, the example they use is so dense you spend chapters just trying to decipher what's going on with the code vs actually seeing how to employ a functional approach to development. Few alternatives are offered as contrast either, say, by showing what one might do in an OO style, then showing how it would be different functionally. Given that Rust is very flexibly do both, it's really important to see the contrast and get a snapshot of how they relate..
The book is just does not deliver on its title. Wait for something better.
Top reviews from other countries
John ChandlerReviewed in the United Kingdom on October 5, 20203.0 out of 5 stars Ignore the Title
Coverage of Rust's functional programming capabilities is sadly quite light, and often only mentioned in passing, which is a shame because it's quite a powerful and expressive part of the language.
This book seemed like the answer I'd been looking for - a book specifically on functional programming in Rust. However, all is not what it seems. Yes, there is some functional programming scattered around the book and it does go into things a bit more than other Rust books, but only just. It mostly seems to cover designing and refactoring a lift/elevator software codebase, with pages of code excerpts that don't really illustrate functional programming. For example, a chapter on mutability and ownership touches on the FFI (Foreign Function Interface) and unsafe functions. Interesting topics, but probably not the ideal way to approach the intended subject especially when presenting the reader with many pages of code.
I've rated the book three stars based on the promise of the title. If you're new to functional programming, new to Rust, or trying to find out more about Rust's functional side then you'll probably be disappointed. There's some useful functional stuff buried in the book, but you'll have to dig around a bit.
However, if you're new to writing larger projects, not necessarily in Rust, you'll probably find this book of more interest. There's content on structuring your project, some more advanced aspects of Rust, a handful of design patterns, and bits on concurrency, performance, debugging, and defensive programming. In some sense, the book should've been marketed more towards these than the functional programming side of things - I can see a lot of readers who could benefit from this book overlooking it because of the title.





