Scala in Depth

By Joshua D. Suereth


Scala in Depth is a distinct new ebook designed that will help you combine Scala successfully into your improvement method. via offering the rising most sensible practices and designs from the Scala group, it courses you thru dozens of robust strategies instance by way of example.

About the Book

Scala is a strong JVM language that blends the sensible and OO programming versions. you will have no hassle getting introductions to Scala in books or on-line, yet it truly is tough to discover nice examples and insights from skilled practitioners. you will discover them in Scala in Depth.

There's little heavy-handed concept here—just dozens of crisp, useful thoughts for coding in Scala. Written for readers who comprehend Java, Scala, or one other OO language.

buy of the print e-book comes with a proposal of a unfastened PDF, ePub, and Kindle publication from Manning. additionally on hand is all code from the publication.

What's Inside

  • Concise, expressive, and readable code style
  • How to combine Scala into your latest Java projects
  • Scala's 2.8.0 collections API
  • How to exploit actors for concurrent programming
  • Mastering the Scala kind system
  • Scala's OO features—type member inheritance, a number of inheritance, and composition
  • Functional thoughts and patterns—immutability, applicative functors, and monads


Table of Contents

  1. Scala—a mixed language
  2. The middle rules
  3. Modicum of style—coding conventions
  4. Utilizing item orientation
  5. Using implicits to jot down expressive code
  6. The sort system
  7. Using implicits and kinds together
  8. Using the proper collection
  9. Actors
  10. Integrating Scala with Java
  11. Patterns in sensible programming

Show description

Quick preview of Scala in Depth PDF

Similar Java books

Mastering Lambdas: Java Programming in a Multicore World (Oracle Press)

The Definitive advisor to Lambda Expressions learning Lambdas: Java Programming in a Multicore international describes how the lambda-related positive factors of Java SE eight will permit Java to fulfill the demanding situations of next-generation parallel architectures. The booklet explains the way to write lambdas, and the way to take advantage of them in streams and in assortment processing, delivering code examples all through.

Mastering JavaFX 8 Controls (Oracle Press)

Layout and install High-Performance JavaFX Controls bring cutting-edge purposes with visually gorgeous UIs. studying JavaFX eight Controls presents transparent directions, unique examples, and ready-to-use code samples. the best way to paintings with the newest JavaFX APIs, configure UI parts, immediately generate FXML, construct state-of-the-art controls, and successfully observe CSS styling.

Data Abstraction and Problem Solving with Java: Walls and Mirrors (3rd Edition)

The 3rd version of information Abstraction and challenge fixing with Java: partitions and Mirrors employs the analogies of partitions (data abstraction) and Mirrors (recursion) to coach Java programming layout ideas, in a fashion that starting scholars locate obtainable. The ebook has a student-friendly pedagogical method that conscientiously debts for the strengths and weaknesses of the Java language.

Java Software Solutions: Foundations of Program Design (7th Edition)

Java software program suggestions teaches a beginning of programming options to foster well-designed object-oriented software program. Heralded for its integration of small and massive lifelike examples, this world wide best-selling textual content emphasizes construction good problem-solving and layout talents to write down fine quality courses.

Extra resources for Scala in Depth

Show sample text content

Ultimately, we explored intensive the conditional execution and kind point programming. This complex strategy has a tendency for use in middle libraries and never as a lot in consumer code. the most topic in all of those sections is that Scala permits builders to maintain variety details whereas writing low-level accepted features. The extra sort info that may be preserved, the extra mistakes the compiler can seize. for instance, the synchronize strategy outlined in part 7. three was once in a position to hinder unintentional argument reversal via shooting the from and to kinds. The HList type permits builders to create arbitrarily lengthy typed lists of parts that may be converted at once instead of passing round a List[Any] and having to figure out the categories of every aspect at runtime. This additionally prevents clients from putting the incorrect variety at a given index. Writing low-level universal capabilities is additionally very important. the fewer a style or classification assumes approximately its arguments or kinds, the extra versatile it really is and the extra frequently it may be reused. In part 7. 2, the implicit on hand of the <:< type was once used so as to add a comfort procedure at once at the Set classification. the following bankruptcy covers the Scala collections library, and we make heavy use of the ideas outlined during this bankruptcy. specifically, the collections library makes an attempt to come the main particular assortment kind attainable after any process name. This has a few attention-grabbing outcomes, as you’ll see. bankruptcy eight. utilizing the perfect assortment during this bankruptcy deciding upon the ideal assortment for an set of rules Descriptions of immutable assortment kinds Descriptions of mutable assortment varieties altering the execution semantics of a suite from strict to lazy and again altering the execution semantics of a set from sequential to parallel and again Writing equipment for all assortment kinds The Scala collections library is the only such a lot extraordinary library within the Scala surroundings. It’s utilized in each venture and offers myriad software capabilities. The Scala collections offer many ways of storing and manipulating facts, that are overwhelming. simply because lots of the tools outlined on Scala collections can be found on each assortment, it’s vital to grasp what the gathering kinds suggest by way of functionality and utilization styles. Scala’s collections additionally break up into 3 dichotomies: Immutable and mutable collections keen and behind schedule review Sequential and parallel evaluate every one of those six different types might be worthwhile. occasionally parallel execution can significantly increase throughput, and infrequently delaying the overview of a mode can increase functionality. The Scala collections library presents the ability for builders to settle on the attributes their collections must have. We’ll speak about those in sections eight. 2 via eight. four the largest trouble with the entire new strength from the collections library is operating generically throughout collections. We talk about a method to address this in part eight. five. Let’s examine the major strategies within the Scala assortment library and while to take advantage of every one.

Download PDF sample

Rated 4.14 of 5 – based on 37 votes