Functional Programming for Mortals with Cats in ScalaКНИГИ » ПРОГРАММИНГ
Название: Functional Programming for Mortals with Cats in Scala Автор: Zara Turtle Издательство: Leanpub Год: 2020 Страниц: 265 Язык: английский Формат: pdf (true), mobi, epub Размер: 22.4 MB
Find out why everybody is talking about functional programming!
This book uses Typelevel Cats 2.1, the most popular Functional Programming framework for Scala. Typelevel has a wealth of accessible and idiomatic learning resources in a welcoming and safe environment. This book is designed to be read from cover to cover, in the order presented, with a rest between chapters. Earlier chapters encourage coding styles that we will later discredit: similar to how we learn Newton’s theory of gravity as children, and progress to Riemann / Einstein / Maxwell if we become students of physics.
A computer is not necessary to follow along, but studying the Cats source code is encouraged. Some of the more complex code snippets are available with the book’s source code and those who want practical exercises are encouraged to (re-)implement Cats (and the example application) using the partial descriptions presented in this book.
For most developers, functional programming (FP) means using immutable data as much as possible, but mutable state is still a necessary evil that must be isolated and managed, e.g. with Akka actors or synchronized classes. This style of FP results in simpler programs that are easier to parallelise and distribute, an improvement over Java. But it is only scratching the surface of the benefits of FP, as we will discover in this book.
Scala also brings Future, making it easy to write asynchronous applications. But when a Future makes it into a return type, everything needs to be rewritten to accomodate it, including the tests, which are now subject to arbitrary timeouts.
Functional Programming is the act of writing programs with pure functions. Pure functions have three properties: - Total: return a value for every possible input - Deterministic: return the same value for the same input - Inculpable: no (direct) interaction with the world or program state.
Together, these properties give us an unprecedented ability to reason about our code. For example, input validation is easier to isolate with totality, caching is possible when functions are deterministic, and interacting with the world is easier to control, and test, when functions are inculpable.
Скачать Functional Programming for Mortals with Cats in Scala
Functional Programming for Mortals with Scalaz Название: Functional Programming for Mortals with Scalaz Автор: Sam Halliday Издательство: Lean Publishing Год: 2020-04-21 Формат: true pdf/epub/mobi...
Get Programming with Scala (MEAP) Название: Get Programming with Scala (MEAP Version 5) Автор: Daniela Sfregola Издательство: Manning Publications Co Год: 2020 Формат: true...
The Neophyte's Guide to Scala Название: The Neophyte's Guide to Scala Автор: Daniel Westheide Издательство: Leanpub Год: 2018 Страниц: 127 Язык: английский Формат: pdf...
Pro Functional PHP Programming Название: Pro Functional PHP Programming: Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity...