Functional Programming in Scala

Functional Programming in Scala

Paul Chiusano, Runar Bjarnason

Language: English

Pages: 304

ISBN: 1617290653

Format: PDF / Kindle (mobi) / ePub


Functional programming (FP) is a programming style emphasizing functions that return consistent and predictable results regardless of a program's state. As a result, functional code is easier to test and reuse, simpler to parallelize, and less prone to bugs. Scala is an emerging JVM language that offers strong support for FP. Its familiar syntax and transparent interoperability with existing Java libraries make Scala a great place to start learning FP.

Functional Programming in Scala is a serious tutorial for programmers looking to learn FP and apply it to the everyday business of coding. The book guides readers from basic techniques to advanced topics in a logical, concise, and clear progression. In it, they'll find concrete examples and exercises that open up the world of functional programming.

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

Big Data: Principles and best practices of scalable realtime data systems

Intelligent Networks: Recent Approaches and Applications in Medical Systems

Planning Algorithms

Todd Lammle's CCNA/CCENT IOS Commands Survival Guide: Exams 100-101, 200-101, and 200-120

Computer Architecture: A Quantitative Approach (5th Edition)

Python Network Programming Cookbook

 

 

 

 

 

 

 

 

 

 

Various static methods in Executors to get a feel for the different implementations of ExecutorService that exist. Then, before continuing, go back and revisit your implementation of fork and try to find a counterexample or convince yourself that the law holds for your implementation. SIDEBAR Why laws about code and proofs are important It may seem unusual to state and prove properties about an API. This certainly isn't something typically done in ordinary programming. Why is it important in FP?.

Urbina http://www.manning-sandbox.com/forum.jspa?forumID=805 2 you must be skeptical, don't let this skepticism get in the way of learning. When you start to feel more fluent at expressing functional programs, then take a step back and evaluate what you think of the FP approach. This book does not require any prior experience with Scala, but we won't spend a lot of time and space discussing Scala's syntax and language features. Instead we'll introduce them as we go,.

Representation. We can remove the type parameter from Parsers: ©Manning Publications Co. We welcome reader comments about anything in the manuscript — other than typos and other simple mistakes. These will be cleaned up during production of the book by copyeditors and proofreaders. Licensed to Leonardo Urbina http://www.manning-sandbox.com/forum.jspa?forumID=805 162 Footnote 13mWe could also represent ParseError as a trie in which shared prefixes of the error stack.

During production of the book by copyeditors and proofreaders. Licensed to Leonardo Urbina http://www.manning-sandbox.com/forum.jspa?forumID=805 181 op(op(op(a, b), c), d) But folding in parallel looks like this: op(op(a, b), op(c, d)) This parallelism might give us some efficiency gains, because the two inner op s could be run simultaneously in separate threads. 10.3.1 Example: Parallel parsing As a nontrivial use case, let's say that we wanted to count the number.

Concatenate a list of strings, doing so with a left or right fold can be less efficient than we would like. Consider the memory usage of this expression: List("lorem", "ipsum", "dolor", "sit").foldLeft("")(_ + _) ©Manning Publications Co. We welcome reader comments about anything in the manuscript — other than typos and other simple mistakes. These will be cleaned up during production of the book by copyeditors and proofreaders. Licensed to Leonardo Urbina .

Download sample

Download