Muutke küpsiste eelistusi

E-raamat: Programming Scala

  • Formaat: 556 pages
  • Ilmumisaeg: 26-May-2021
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781492077862
  • Formaat - PDF+DRM
  • Hind: 47,96 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: 556 pages
  • Ilmumisaeg: 26-May-2021
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781492077862

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Get up to speed on Scala--the JVM, JavaScript, and natively compiled language that offers all the benefits of functional programming, a modern object model, and an advanced type system. Packed with code examples, this comprehensive book shows you how to be productive with the language and ecosystem right away. You'll learn why Scala is ideal for today's highly scalable, data-centric applications that support concurrency and distribution.

Despite the reinvigoration of Java and the introduction of Kotlin, Scala hasn't been sitting still. This third edition covers the new features in Scala 3.0, with updates throughout the book. Programming Scala is ideal for beginning to advanced developers who want a complete understanding of Scala's design philosophy and features with a thoroughly practical focus.

  • Program faster with Scala's succinct and flexible syntax
  • Dive into basic and advanced functional programming (FP) techniques
  • Build killer big data and distributed apps, using Scala's functional combinators and tools including Akka and Spark
  • Use traits for mixin composition and pattern matching for data extraction
  • Learn the sophisticated type system that combines functional programming and object-oriented programming concepts
Foreword xvii
Preface xxi
1 Zero To Sixty: Introducing Scala
1(30)
Why Scala?
1(2)
The Appeal of Scala
2(1)
Why Scala 3?
3(1)
Migrating to Scala 3
3(1)
Installing the Scala Tools You Need
3(1)
Building the Code Examples
4(1)
More Tips
5(4)
Using sbt
5(2)
Running the Scala Command-Line Tools Using sbt
7(2)
A Taste of Scala
9(11)
A Sample Application
20(9)
Recap and What's Next
29(2)
2 Type Less, Do More
31(40)
New Scala
3(28)
Syntax--Optional Braces
31(2)
Semicolons
33(1)
Variable Declarations
33(2)
Ranges
35(1)
Partial Functions
36(3)
Method Declarations
39(9)
Method Default and Named Parameters
39(1)
Methods with Multiple Parameter Lists
40(5)
Nesting Method Definitions and Recursion
45(3)
Inferring Type Information
48(1)
Repeated Parameter Lists
49(2)
Language Keywords
51(3)
Literal Values
54(4)
Numeric Literals
54(1)
Boolean Literals
55(1)
Character Literals
56(1)
String Literals
56(2)
Symbol Literals
58(1)
Function Literals
58(1)
Tuples
58(2)
Option, Some, and None: Avoiding Nulls
60(2)
When You Really Can't Avoid Nulls
61(1)
Sealed Class Hierarchies and Enumerations
62(1)
Organizing Code in Files and Namespaces
63(1)
Importing Types and Their Members
64(2)
Package Imports and Package Objects
65(1)
Parameterized Types Versus Abstract Type Members
66(3)
Recap and What's Next
69(2)
3 Rounding Out The Basics
71(34)
Defining Operators
71(5)
Allowed Characters in Identifiers
76(1)
Methods with Empty Parameter Lists
77(1)
Operator Precedence Rules
78(1)
Enumerations and Algebraic Data Types
79(3)
Interpolated Strings
82(1)
Scala Conditional Expressions
83(2)
Conditional and Comparison Operators
85(1)
For Comprehensions
86(4)
For Loops
86(1)
Generators
87(1)
Guards: Filtering Values
87(1)
Yielding New Values
87(1)
Expanded Scope and Value Definitions
88(2)
Scala while Loops
90(1)
Using try, catch, and finally Clauses
90(4)
Call by Name, Call by Value
94(3)
Lazy Values
97(2)
Traits: Interfaces and Mixins in Scala
99(3)
When new Is Optional
102(1)
Recap and What's Next
103(2)
4 Pattern Matching
105(32)
Safer Pattern Matching with Matchable
105(2)
Values, Variables, and Types in Matches
107(4)
Matching on Sequences
111(3)
Pattern Matching on Repeated Parameters
114(1)
Matching on Tuples
114(3)
Parameter Untupling
116(1)
Guards in Case Clauses
117(1)
Matching on Case Classes and Enums
117(3)
Matching on Regular Expressions
120(1)
Matching on Interpolated Strings
121(1)
Sealed Hierarchies and Exhaustive Matches
121(1)
Chaining Match Expressions
122(1)
Pattern Matching Outside Match Expressions
122(2)
Problems in Pattern Bindings
124(1)
Pattern Matching as Filtering in for Comprehensions
125(1)
Pattern Matching and Erasure
126(1)
Extractors
127(8)
Unapply Method
127(2)
Alternatives to Option Return Values
129(3)
Unapplyseq Method
132(2)
Implementing unapplySeq
134(1)
Recap and What's Next
135(2)
5 Abstracting Over Context: Type Classes And Extension Methods
137(28)
Four Changes
138(1)
Extension Methods
139(3)
Build Your Own String Interpolator
142(1)
Type Classes
142(12)
Scala 3 Type Classes
143(7)
Alias Givens
150(2)
Scala 2 Type Classes
152(2)
Scala 3 Implicit Conversions
154(4)
Type Class Derivation
158(1)
Givens and Imports
159(2)
Givens Scoping and Pattern Matching
161(1)
Resolution Rules for Givens and Extension Methods
162(1)
The Expression Problem
163(1)
Recap and What's Next
163(2)
6 Abstracting Over Context: Using Clauses
165(20)
Using Clauses
165(2)
Context Bounds
167(4)
Other Context Parameters
171(1)
Context Functions
172(3)
Constraining Allowed Instances
175(4)
Implicit Evidence
178(1)
Working Around Type Erasure with Using Clauses
179(1)
Rules for Using Clauses
180(2)
Improving Error Messages
182(1)
Recap and What's Next
183(2)
7 Functional Programming In Scala
185(40)
What Is Functional Programming?
185(5)
Functions in Mathematics
186(1)
Variables That Aren't
187(3)
Functional Programming in Scala
190(3)
Anonymous Functions, Lambdas, and Closures
190(3)
Purity Inside Versus Outside
193(1)
Recursion
193(1)
Tail Calls and Tail-Call Optimization
194(1)
Partially Applied Functions Versus Partial Functions
195(1)
Currying and Uncurrying Functions
196(1)
Tupled and Untupled Functions
197(1)
Partial Functions Versus Functions Returning Options
198(1)
Functional Data Structures
199(5)
Sequences
200(2)
Maps
202(1)
Sets
203(1)
Traversing, Mapping, Filtering, Folding, and Reducing
204(15)
Traversing
204(1)
Mapping
205(1)
Flat Mapping
206(2)
Filtering
208(2)
Folding and Reducing
210(5)
Left Versus Right Folding
215(4)
Combinators: Software's Best Component Abstractions
219(3)
What About Making Copies?
222(2)
Recap and What's Next
224(1)
8 For Comprehensions In Depth
225(20)
Recap: The Elements of for Comprehensions
225(2)
For Comprehensions: Under the Hood
227(3)
Translation Rules of for Comprehensions
230(2)
Options and Container Types
232(11)
Option as a Container?
232(4)
Either: An Alternative to Option
236(3)
Try: When There Is No Do
239(2)
Validated from the Cats Library
241(2)
Recap and What's Next
243(2)
9 Object-Oriented Programming In Scala
245(26)
Class and Object Basics: Review
246(1)
Open Versus Closed Types
247(5)
Classes Open for Extension
250(1)
Overriding Methods? The Template Method Pattern
251(1)
Reference Versus Value Types
252(1)
Opaque Types and Value Classes
253(8)
Opaque Type Aliases
255(3)
Value Classes
258(3)
Supertypes
261(1)
Constructors in Scala
262(1)
Calling Supertype Constructors
263(1)
Export Clauses
263(2)
Good Object-Oriented Design: A Digression
265(2)
Fields in Types
267(3)
The Uniform Access Principle
268(2)
Unary Methods
270(1)
Recap and What's Next
270(1)
10 Traits
271(14)
Traits as Mixins
271(4)
Stackable Traits
275(4)
Union and Intersection Types
279(2)
Transparent Traits
281(1)
Using Commas Instead of with
282(1)
Trait Parameters
282(2)
Should That Type Be a Class or Trait?
284(1)
Recap and What's Next
284(1)
11 Variance Behavior And Equality
285(16)
Parameterized Types: Variance Under Inheritance
285(7)
Functions Under the Hood
286(4)
Variance of Mutable Types
290(2)
Improper Variance of Java Arrays
292(1)
Equality of Instances
292(3)
The equals Method
293(1)
The == and != Methods
293(1)
The eq and ne Methods
294(1)
Array Equality and the sameElements Method
294(1)
Equality and Inheritance
295(1)
Multiversal Equality
296(3)
Case Objects and hashCode
299(1)
Recap and What's Next
300(1)
12 Instance Initialization And Method Resolution
301(10)
Linearization of a Type Hierarchy
301(4)
Initializing Abstract Fields
305(2)
Overriding Concrete Fields
307(1)
Abstract Type Members and Concrete Type Aliases
308(1)
Recap and What's Next
309(2)
13 The Scala Type Hierarchy
311(14)
Much Ado About Nothing (and Null)
312(3)
The scala Package
315(1)
Products, Case Classes, Tuples, and Functions
316(3)
Tuples and the Tuple Trait
317(2)
The Predef Object
319(4)
Implicit Conversions
319(2)
Type Definitions
321(1)
Condition Checking Methods
321(1)
Input and Output Methods
322(1)
Miscellaneous Methods
323(1)
Recap and What's Next
323(2)
14 The Scala Collections Library
325(16)
Different Groups of Collections
326(1)
Abstractions with Multiple Implementations
326(7)
The scala.collection.immutable Package
327(2)
The scala.collection.mutable Package
329(2)
The scalaxollection Package
331(2)
The scala.collection.concurrent Package
333(1)
The scalaxollection.convert Package
333(1)
The scalaxollection.generic Package
333(1)
Construction of Instances
333(2)
The Iterable Abstraction
335(1)
Polymorphic Methods
336(1)
Equality for Collections
337(1)
Nonstrict Collections: Views
338(1)
Recap and What's Next
339(2)
15 Visibility Rules
341(6)
Public Visibility: The Default
342(1)
Visibility Keywords
342(1)
Protected Visibility
343(1)
Private Visibility
343(1)
Scoped Private and Protected Visibility
343(2)
Recap and What's Next
345(2)
16 Scala's Type System, Part 1
347(22)
Parameterized Types
347(1)
Abstract Type Members and Concrete Type Aliases
348(1)
Comparing Abstract Type Members Versus Parameterized Types
348(1)
Type Bounds
349(3)
Upper Type Bounds
349(1)
Lower Type Bounds
350(2)
Context Bounds
352(1)
View Bounds
352(1)
Intersection and Union Types
353(6)
Intersection Types
353(3)
Union Types
356(3)
Phantom Types
359(3)
Structural Types
362(5)
Refined Types
367(1)
Existential Types (Obsolete)
367(1)
Recap and What's Next
368(1)
17 Scala's Type System, Part II
369(28)
Match Types
369(2)
Dependently Typed Methods
371(2)
Dependent Method and Dependent Function Types
373(1)
Dependent Typing
374(6)
Path-Dependent Types
380(2)
Using this
380(1)
Using super
381(1)
Stable Paths
381(1)
Self-Type Declarations
382(3)
Type Projections
385(1)
More on Singleton Types
386(1)
Self-Recursive Types: F-Bounded Polymorphism
387(1)
Higher-Kinded Types
388(3)
Type Lambdas
391(2)
Polymorphic Functions
393(1)
Type Wildcard Versus Placeholder
394(1)
Recap and What's Next
395(2)
18 Advanced Functional Programming
397(14)
Algebraic Data Types
397(3)
Sum Types Versus Product Types
397(2)
Properties of Algebraic Data Types
399(1)
Final Thoughts on Algebraic Data Types
400(1)
Category Theory
400(9)
What Is a Category?
401(1)
Functor
402(2)
The Monad Endofunctor
404(4)
The Semigroup and Monoid Categories
408(1)
Recap and What's Next
409(2)
19 Tools For Concurrency
411(18)
The scala.sys.process Package
411(2)
Futures
413(3)
Robust, Scalable Concurrency with Actors
416(10)
Akka: Actors for Scala
417(8)
Actors: Final Thoughts
425(1)
Stream Processing
426(1)
Recap and What's Next
427(2)
20 Dynamic Invocation In Scala
429(10)
Structural Types Revisited
429(3)
A Motivating Example: ActiveRecord in Ruby on Rails
432(1)
Dynamic Invocation with the Dynamic Trait
433(4)
DSL Considerations
437(1)
Recap and What's Next
437(2)
21 Domain-Specific Languages In Scala
439(12)
Internal DSLs
440(6)
External DSLs with Parser Combinators
446(3)
About Parser Combinators
447(1)
A Payroll External DSL
447(2)
Internal Versus External DSLs: Final Thoughts
449(1)
Recap and What's Next
450(1)
22 Scala Tools And Libraries
451(16)
Scala 3 Versions
451(1)
Command-Line Interface Tools
452(5)
Coursier
453(1)
Managing Java JDKs with Coursier
453(1)
The scalac Command-Line Tool
454(1)
The scala Command-Line Tool
455(1)
The scaladoc Command-Line Tool
456(1)
Other Scala Command-Line Tools
456(1)
Build Tools
457(1)
Integration with IDEs and Text Editors
457(1)
Using Notebook Environments with Scala
457(1)
Testing Tools
458(1)
Scala for Big Data: Apache Spark
459(2)
Typelevel Libraries
461(1)
Li Haoyi Libraries
462(1)
Java and Scala Interoperability
462(3)
Using Java Identifiers in Scala Code
462(1)
Scala Identifiers in Java Code
463(1)
Java Generics and Scala Parameterized Types
463(1)
Conversions Between Scala and Java Collections
464(1)
Java Lambdas Versus Scala Functions
464(1)
Annotations for JavaBean Properties and Other Purposes
464(1)
Recap and What's Next
465(2)
23 Application Design
467(18)
Recap of What We Already Know
467(1)
Annotations
468(1)
Using @main Entry Points
469(1)
Design Patterns
470(4)
Creational Patterns
470(1)
Structural Patterns
471(1)
Behavioral Patterns
472(2)
Better Design with Design by Contract
474(3)
The Parthenon Architecture
477(6)
Recap and What's Next
483(2)
24 Metaprogramming: Macros And Reflection
485(18)
Scala Compile Time Reflection
487(1)
Java Runtime Reflection
488(2)
Scala Reflect API
490(1)
Type Class Derivation: Implementation Details
491(1)
Scala 3 Metaprogramming
491(11)
Inline
491(5)
Macros
496(4)
Staging
500(2)
Wrapping Up and Looking Ahead
502(1)
A Significant Indentation Versus Braces Syntax 503(4)
Bibliography 507(2)
Index 509
Dean Wampler (@deanwampler) is an expert in streaming data systems, focusing on applications of ML/AI. He is Head of Evangelism at Anyscale.io, which is focused on distributed Python for ML/AI. Previously, he was an engineering VP at Lightbend, where he led the development of Lightbend CloudFlow, an integrated system for building and running streaming data applications with Akka Streams, Apache Spark, Apache Flink, and Apache Kafka. Dean is the author of Fast Data Architectures for Streaming Applications, Programming Scala, Functional Programming for Java Developers, and the coauthor of Programming Hive, all from O'Reilly. He's a contributor to several open source projects. A frequent Strata Data Conference speaker, he's also the co-organizer of several conferences around the world and several user groups in Chicago. He has a Ph.D. in Physics from the University of Washington.