Hands-On Functional Programming in Rust
Book information
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. 1: FUNCTIONAL PROGRAMMING – A COMPARISON Technical requirements Reducing code weight and complexity Strict abstraction means safe abstraction Improving project architecture Summary Questions Further reading 2: FUNCTIONAL CONTROL FLOW Technical requirements Designing the program Implementing program logic Writing tests Summary Questions 3: FUNCTIONAL DATA STRUCTURES Technical requirements Adjusting to changing the scope of the project Mapping requirements directly to code Running simulations and analyzing data Summary Questions 4: GENERICS AND POLYMORPHISM Technical requirements Staying productive during downtime Learning about generics Applying parameterization concepts Summary Questions 5: CODE ORGANIZATION AND APPLICATION ARCHITECTURE Technical requirements Shipping a product without sacrificing quality Reorganizing the project Mapping code changes and additions Summary Questions 6: MUTABILITY, OWNERSHIP, AND PURE FUNCTIONS Technical requirements Recognizing anti-patterns of ownership Learning the rules of ownership Using immutable data Using pure functions Summary Questions 7: DESIGN PATTERNS Technical requirements Using the functor pattern Using the monad pattern Using the combinator pattern Using the lazy evaluation pattern Summary Questions 8: IMPLEMENTING CONCURRENCY Technical requirements Using subprocess concurrency Understanding nix fork concurrency Using thread concurrency Understanding Send and Sync traits Using functional design for concurrency Summary Questions 9: PERFORMANCE, DEBUGGING, AND METAPROGRAMMING Technical requirements Writing faster code Preventing bugs with defensive coding Finding and fixing bugs Metaprogramming Summary Questions
Similar books
Short Guide to Action Research, A
2011 · PDF
How To Be A Day Trading King: Day Trade Like A King
2017 · EPUB
The Earth… but not As We Know It – An Exploration
2019 · PDF
Top 10 Reasons Why You Should Have Your Profile In Social Media Networking Sites - And Much More - 101 World Class Expert Facts, Hints, Tips And Advice On Social Media
2012 · EPUB
Cryptocurrency--How to Make a Lot of Money Investing and Trading in Cryptocurrency: Unlocking the Lucrative World of Cryptocurrency
2017 · EPUB
9/11 Finding the Truth
2018 · EPUB
Stocks--The Ultimate Guide to Investing and Trading Stocks: Getting an Edge with Trading Stocks
2017 · EPUB
Swing Trading: The Definitive And Step by Step Guide To Swing Trading: Trade Like A Pro (How to Invest and Trade Like a Pro Book 1)
EPUB