Scala for the Impatient, 3rd Edition
- Length: 400 pages
- Edition: 3
- Language: English
- Publisher: Addison-Wesley Professional
- Publication Date: 2023
- ISBN-10: 013803365X
- ISBN-13: 9780138033651
- Sales Rank: #0 (See Top 100 Books)
Clear, Concise Guide to Scala for Professional Programmers–Updated through Scala 3.x
Scala 3 is more concise, consistent, flexible, robust, and efficient, but there’s a lot to learn and navigating features and improvements can be challenging.
Scala for the Impatient, Third Edition,
is a complete yet concise guide that reflects the major enhancements of Scala 3, from improved syntax and revamped type system to powerful contextual abstractions.
Written by renowned programming instructor Cay S. Horstmann–author of the classic Core Java–this indispensable tutorial offers a faster, easier pathway for learning today’s Scala. Horstmann covers everything working developers need to know, focusing on hands-on solutions, not academic theory. Given the size and scope of Scala 3, there’s plenty to cover but it’s presented in small chunks organized for quick access and easy understanding, with plenty of practical insights and focused sample code.
Get started quickly with Scala 3 interpreter, syntax, tools, and current usage Master core language features: functions, arrays, maps, tuples, packages, imports, exception handling, and more Design and build better object-oriented code with Scala 3 Use Scala for real-world programming tasks: working with files, regular expressions, and XML Work with higher-order functions and the powerful Scala collections library Create concurrent programs with Scala futures Understand the Scala type system, including revamped enums, intersection and union types, and enhanced type inference Use contextual abstractions to easily extend class hierarchies, enrich existing classes, perform automatic conversions, and elegantly hide tedious details Apply advanced power tools such as annotations and implicits Discover how to program with types, analyzing and generating types at compile time Get a taste of what’s now possible with Scala macros If you’re a Java, C++, or C# programmer who’s new to Scala or functional programming–or even if you’ve already used earlier versions of Scala–this guide will help you write code that’s more robust, more efficient, and more secure.
Cover Page Title Page Table of Contents Contents Foreword to the First Edition Preface About the Author Chapter 1. The Basics 1.1 The Scala Interpreter 1.2 Declaring Values and Variables 1.3 Commonly Used Types 1.4 Arithmetic and Operator Overloading 1.5 More about Calling Methods 1.6 The apply Method 1.7 Scaladoc Exercises Chapter 2. Control Structures and Functions 2.1 Conditional Expressions 2.2 Statement Termination 2.3 Block Expressions and Assignments 2.4 Input and Output 2.5 Loops 2.6 More about the for Loop 2.7 Functions 2.8 Default and Named Arguments L1 2.9 Variable Arguments L1 2.10 The Main Function 2.11 Functions without Parameters 2.12 Lazy Values L1 2.13 Exceptions Exercises Chapter 3. Working with Arrays 3.1 Fixed-Length Arrays 3.2 Variable-Length Arrays: Array Buffers 3.3 Traversing Arrays and Array Buffers 3.4 Transforming Arrays 3.5 Common Algorithms 3.6 Deciphering Scaladoc 3.7 Multidimensional Arrays 3.8 Interoperating with Java Exercises Chapter 4. Maps, Options, and Tuples 4.1 Constructing a Map 4.2 Accessing Map Values 4.3 Updating Map Values 4.4 Iterating over Maps 4.5 Linked and Sorted Maps 4.6 Interoperating with Java 4.7 The Option Type 4.8 Tuples 4.9 Zipping Exercises Chapter 5. Classes 5.1 Simple Classes and Parameterless Methods 5.2 Properties with Getters and Setters 5.3 Properties with Only Getters 5.4 Private Fields 5.5 Auxiliary Constructors 5.6 The Primary Constructor 5.7 Nested Classes L1 Exercises Chapter 6. Objects and Enumerations 6.1 Singletons 6.2 Companion Objects 6.3 Objects Extending a Class or Trait 6.4 The apply Method 6.5 Application Objects 6.6 Enumerations Exercises Chapter 7. Packages, Imports, and Exports 7.1 Packages 7.2 Package Scope Nesting 7.3 Chained Package Clauses 7.4 Top-of-File Notation 7.5 Package-Level Functions and Variables 7.6 Package Visibility 7.7 Imports 7.8 Imports Can Be Anywhere 7.9 Renaming and Hiding Members 7.10 Implicit Imports 7.11 Exports Exercises Chapter 8. Inheritance 8.1 Extending a Class 8.2 Overriding Methods 8.3 Type Checks and Casts 8.4 Superclass Construction 8.5 Anonymous Subclasses 8.6 Abstract Classes 8.7 Abstract Fields 8.8 Overriding Fields 8.9 Open and Sealed Classes 8.10 Protected Fields and Methods 8.11 Construction Order 8.12 The Scala Inheritance Hierarchy 8.13 Object Equality L1 8.14 Multiversal Equality L2 8.15 Value Classes L2 Exercises Chapter 9. Files and Regular Expressions 9.1 Reading Lines 9.2 Reading Characters 9.3 Reading Tokens and Numbers 9.4 Reading from URLs and Other Sources 9.5 Writing Files 9.6 Visiting Directories 9.7 Serialization 9.8 Process Control A2 9.9 Regular Expressions 9.10 Regular Expression Groups Exercises Chapter 10. Traits 10.1 Why No Multiple Inheritance? 10.2 Traits as Interfaces 10.3 Traits with Concrete Methods 10.4 Traits for Rich Interfaces 10.5 Objects with Traits 10.6 Layered Traits 10.7 Overriding Abstract Methods in Traits 10.8 Concrete Fields in Traits 10.9 Abstract Fields in Traits 10.10 Trait Construction Order 10.11 Trait Constructors with Parameters 10.12 Traits Extending Classes 10.13 What Happens under the Hood 10.14 Transparent Traits L2 10.15 Self Types L2 Exercises Chapter 11. Operators 11.1 Identifiers 11.2 Infix Operators 11.3 Unary Operators 11.4 Assignment Operators 11.5 Precedence 11.6 Associativity 11.7 The apply and update Methods 11.8 The unapply Method L2 11.9 The unapplySeq Method L2 11.10 Alternative Forms of the unapply and unapplySeq Methods L3 11.11 Dynamic Invocation L2 11.12 Typesafe Selection and Application L2 Exercises Chapter 12. Higher-Order Functions 12.1 Functions as Values 12.2 Anonymous Functions 12.3 Parameters That Are Functions 12.4 Parameter Inference 12.5 Useful Higher-Order Functions 12.6 Closures 12.7 Interoperability with Lambda Expressions 12.8 Currying 12.9 Methods for Composing, Currying, and Tupling 12.10 Control Abstractions 12.11 The return Expression Exercises Chapter 13. Collections 13.1 The Main Collections Traits 13.2 Mutable and Immutable Collections 13.3 Sequences 13.4 Lists 13.5 Sets 13.6 Operators for Adding or Removing Elements 13.7 Common Methods 13.8 Mapping a Function 13.9 Reducing, Folding, and Scanning A3 13.10 Zipping 13.11 Iterators 13.12 Lazy Lists A3 13.13 Interoperability with Java Collections Exercises Chapter 14. Pattern Matching 14.1 A Better Switch 14.2 Guards 14.3 Variables in Patterns 14.4 Type Patterns 14.5 The Matchable Trait 14.6 Matching Arrays, Lists, and Tuples 14.7 Extractors 14.8 Patterns in Variable Declarations 14.9 Patterns in for Expressions 14.10 Case Classes 14.11 Matching Nested Structures 14.12 Sealed Classes 14.13 Parameterized Enumerations 14.14 Partial Functions A3 14.15 Infix Notation in case Clauses L2 Exercises Chapter 15. Annotations 15.1 What Are Annotations? 15.2 Annotation Placement 15.3 Annotation Arguments 15.4 Annotations for Java Features 15.4.1 Bean Properties 15.4.2 Serialization 15.4.3 Checked Exceptions 15.4.4 Variable Arguments 15.4.5 Java Modifiers 15.5 Annotations for Optimizations 15.5.1 Tail Recursion 15.5.2 Lazy Values 15.6 Annotations for Errors and Warnings 15.7 Annotation Declarations Exercises Chapter 16. Futures 16.1 Running Tasks in the Future 16.2 Waiting for Results 16.3 The Try Class 16.4 Callbacks 16.5 Composing Future Tasks 16.6 Other Future Transformations 16.7 Methods in the Future Object 16.8 Promises 16.9 Execution Contexts Exercises Chapter 17. Type Parameters 17.1 Generic Classes 17.2 Generic Functions 17.3 Bounds for Type Variables 17.4 Context Bounds 17.5 The ClassTag Context Bound 17.6 Multiple Bounds 17.7 Type Constraints L3 17.8 Variance 17.9 Co- and Contravariant Positions 17.10 Objects Can’t Be Generic 17.11 Wildcards 17.12 Polymorphic Functions Exercises Chapter 18. Advanced Types 18.1 Union Types 18.2 Intersection Types 18.3 Type Aliases 18.4 Structural Types 18.5 Literal Types 18.6 The Singleton Type Operator 18.7 Abstract Types 18.8 Dependent Types 18.9 Abstract Type Bounds Exercises Chapter 19. Contextual Abstractions 19.1 Context Parameters 19.2 More about Context Parameters 19.3 Declaring Given Instances 19.4 Givens in for and match expressions 19.5 Importing Givens 19.6 Extension Methods 19.7 Where Extension Methods Are Found 19.8 Implicit Conversions 19.9 Rules for Implicit Conversions 19.10 Importing Implicit Conversions 19.11 Context Functions 19.12 Evidence 19.13 The @implicitNotFound Annotation Exercises Chapter 20. Type Level Programming 20.1 Match Types 20.2 Heterogeneous Lists 20.3 Literal Type Arithmetic 20.4 Inline Code 20.5 Type Classes 20.6 Mirrors 20.7 Type Class Derivation 20.8 Higher-Kinded Types 20.9 Type Lambdas 20.10 A Brief Introduction into Macros Exercises
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.