Categories
Bibliography Scala Software Engineering

Programming Scala, 3rd Edition – B095XLMMGC – ISBN-13: 978-1492077893

See: Programming Scala, 3rd Edition, by Dean Wampler, Publisher ‏ : ‎ O’Reilly Media; 3rd edition (May 26, 2021)

Fair Use Source:

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 building today’s highly scalable, data-centric applications while maximizing developer productivity.

While Java remains popular and Kotlin has become popular, Scala hasn’t been sitting still. This third edition covers the new features in Scala 3 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 techniques
  • Build killer big data and distributed apps using Scala’s functional combinators and tools like Spark and Akka
  • Create concise solutions to challenging design problems with the sophisticated type system, mixin composition with traits, pattern matching, and more


Resources

Errata Page: http://oreilly.com/catalog/0636920365686/errata

Supplemental Content: https://github.com/deanwampler/programming-scala-book-code-examples

About the Author

Dean Wampler is an expert in data engineering for scalable streaming data systems and applications of machine learning and artificial intelligence. He is a principal software engineer at Domino Data Lab. Previously he worked at Anyscale and Lightbend, where he worked on scalable machine learning with Ray and distributed streaming data systems with Apache Spark, Apache Kafka, Kubernetes, and other tools. Besides Programming Scala, Dean is also the author of What Is Ray?, Distributed Computing Made Simple, Fast Data Architectures for Streaming Applications, and Functional Programming for Java Developers, as well as the coauthor of Programming Hive, all from O’Reilly. He is a contributor to several open source projects and a frequent conference speaker, and he co-organizes several conferences around the world and several user groups in Chicago. Dean has a PhD in physics from the University of Washington. Find Dean on Twitter: @deanwampler.

Table of Contents:

By Dean Wampler

  1. Foreword
  2. Foreword, Third Edition
  3. Foreword, First and Second Edition
  4. Preface
  5. Welcome to Programming Scala, Third Edition
  6. How to Read This Book
  7. Welcome to Programming Scala, Second Edition
  8. Welcome to Programming Scala, First Edition
  9. Conventions Used in This Book
  10. Using Code Examples
  11. Getting the Code Examples
  12. O’Reilly Online Learning
  13. How to Contact Us
  14. Acknowledgments for the Third Edition
  15. Acknowledgments for the Second Edition
  16. Acknowledgments for the First Edition
  17. 1. Zero To Sixty: Introducing Scalaqueue
  18. Why Scala?
  19. The Appeal of Scala
  20. Why Scala 3?
  21. Migrating to Scala 3
  22. Installing the Scala Tools You Need
  23. Building the Code Examples
  24. More Tips
  25. Using sbt
  26. Running the Scala Command-Line Tools Using sbt
  27. A Taste of Scala
  28. A Sample Application
  29. Recap and What’s Next
  30. 2. Type Less, Do Morequeue
  31. New Scala 3 Syntax—Optional Braces
  32. Semicolons
  33. Variable Declarations
  34. Ranges
  35. Partial Functions
  36. Method Declarations
  37. Method Default and Named Parameters
  38. Methods with Multiple Parameter Lists
  39. Nesting Method Definitions and Recursion
  40. Inferring Type Information
  41. Repeated Parameter Lists
  42. Language Keywords
  43. Literal Values
  44. Numeric Literals
  45. Boolean Literals
  46. Character Literals
  47. String Literals
  48. Symbol Literals
  49. Function Literals
  50. Tuples
  51. Option, Some, and None: Avoiding Nulls
  52. When You Really Can’t Avoid Nulls
  53. Sealed Class Hierarchies and Enumerations
  54. Organizing Code in Files and Namespaces
  55. Importing Types and Their Members
  56. Package Imports and Package Objects
  57. Parameterized Types Versus Abstract Type Members
  58. Recap and What’s Next
  59. 3. Rounding Out The Basics
  60. Defining Operators
  61. Allowed Characters in Identifiers
  62. Methods with Empty Parameter Lists
  63. Operator Precedence Rules
  64. Enumerations and Algebraic Data Types
  65. Interpolated Strings
  66. Scala Conditional Expressions
  67. Conditional and Comparison Operators
  68. for Comprehensions
  69. for Loops
  70. Generators
  71. Guards: Filtering Values
  72. Yielding New Values
  73. Expanded Scope and Value Definitions
  74. Scala while Loops
  75. Using try, catch, and finally Clauses
  76. Call by Name, Call by Value
  77. Lazy Values
  78. Traits: Interfaces and Mixins in Scala
  79. When new Is Optional
  80. Recap and What’s Next
  81. 4. Pattern Matching
  82. Safer Pattern Matching with Matchable
  83. Values, Variables, and Types in Matches
  84. Matching on Sequences
  85. Pattern Matching on Repeated Parameters
  86. Matching on Tuples
  87. Parameter Untupling
  88. Guards in Case Clauses
  89. Matching on Case Classes and Enums
  90. Matching on Regular Expressions
  91. Matching on Interpolated Strings
  92. Sealed Hierarchies and Exhaustive Matches
  93. Chaining Match Expressions
  94. Pattern Matching Outside Match Expressions
  95. Problems in Pattern Bindings
  96. Pattern Matching as Filtering in for Comprehensions
  97. Pattern Matching and Erasure
  98. Extractors
  99. unapply Method
  100. Alternatives to Option Return Values
  101. unapplySeq Method
  102. Implementing unapplySeq
  103. Recap and What’s Next
  104. 5. Abstracting Over Context: Type Classes And Extension Methodsqueue
  105. Four Changes
  106. Extension Methods
  107. Build Your Own String Interpolator
  108. Type Classes
  109. Scala 3 Type Classes
  110. Alias Givens
  111. Scala 2 Type Classes
  112. Scala 3 Implicit Conversions
  113. Type Class Derivation
  114. Givens and Imports
  115. Givens Scoping and Pattern Matching
  116. Resolution Rules for Givens and Extension Methods
  117. The Expression Problem
  118. Recap and What’s Next
  119. 6. Abstracting Over Context: Using Clauses
  120. Using Clauses
  121. Context Bounds
  122. Other Context Parameters
  123. Context Functions
  124. Constraining Allowed Instances
  125. Implicit Evidence
  126. Working Around Type Erasure with Using Clauses
  127. Rules for Using Clauses
  128. Improving Error Messages
  129. Recap and What’s Next
  130. 7. Functional Programming In Scalaqueue
  131. What Is Functional Programming?
  132. Functions in Mathematics
  133. Variables That Aren’t
  134. Functional Programming in Scala
  135. Anonymous Functions, Lambdas, and Closures
  136. Purity Inside Versus Outside
  137. Recursion
  138. Tail Calls and Tail-Call Optimization
  139. Partially Applied Functions Versus Partial Functions
  140. Currying and Uncurrying Functions
  141. Tupled and Untupled Functions
  142. Partial Functions Versus Functions Returning Options
  143. Functional Data Structures
  144. Sequences
  145. Maps
  146. Sets
  147. Traversing, Mapping, Filtering, Folding, and Reducing
  148. Traversing
  149. Mapping
  150. Flat Mapping
  151. Filtering
  152. Folding and Reducing
  153. Left Versus Right Folding
  154. Combinators: Software’s Best Component Abstractions
  155. What About Making Copies?
  156. Recap and What’s Next
  157. 8. For Comprehensions In Depthqueue
  158. Recap: The Elements of for Comprehensions
  159. for Comprehensions: Under the Hood
  160. Translation Rules of for Comprehensions
  161. Options and Container Types
  162. Option as a Container?
  163. Either: An Alternative to Option
  164. Try: When There Is No Do
  165. Validated from the Cats Library
  166. Recap and What’s Next
  167. 9. Object-Oriented Programming In Scalaqueue
  168. Class and Object Basics: Review
  169. Open Versus Closed Types
  170. Classes Open for Extension
  171. Overriding Methods? The Template Method Pattern
  172. Reference Versus Value Types
  173. Opaque Types and Value Classes
  174. Opaque Type Aliases
  175. Value Classes
  176. Supertypes
  177. Constructors in Scala
  178. Calling Supertype Constructors
  179. Export Clauses
  180. Good Object-Oriented Design: A Digression
  181. Fields in Types
  182. The Uniform Access Principle
  183. Unary Methods
  184. Recap and What’s Next
  185. 10. Traitsqueue
  186. Traits as Mixins
  187. Stackable Traits
  188. Union and Intersection Types
  189. Transparent Traits
  190. Using Commas Instead of with
  191. Trait Parameters
  192. Should That Type Be a Class or Trait?
  193. Recap and What’s Next
  194. 11. Variance Behavior And Equalityqueue
  195. Parameterized Types: Variance Under Inheritance
  196. Functions Under the Hood
  197. Variance of Mutable Types
  198. Improper Variance of Java Arrays
  199. Equality of Instances
  200. The equals Method
  201. The == and != Methods
  202. The eq and ne Methods
  203. Array Equality and the sameElements Method
  204. Equality and Inheritance
  205. Multiversal Equality
  206. Case Objects and hashCode
  207. Recap and What’s Next
  208. 12. Instance Initialization And Method Resolutionqueue
  209. Linearization of a Type Hierarchy
  210. Initializing Abstract Fields
  211. Overriding Concrete Fields
  212. Abstract Type Members and Concrete Type Aliases
  213. Recap and What’s Next
  214. 13. The Scala Type Hierarchyqueue
  215. Much Ado About Nothing (and Null)
  216. The scala Package
  217. Products, Case Classes, Tuples, and Functions
  218. Tuples and the Tuple Trait
  219. The Predef Object
  220. Implicit Conversions
  221. Type Definitions
  222. Condition Checking Methods
  223. Input and Output Methods
  224. Miscellaneous Methods
  225. Recap and What’s Next
  226. 14. The Scala Collections Libraryqueue
  227. Different Groups of Collections
  228. Abstractions with Multiple Implementations
  229. The scala.collection.immutable Package
  230. The scala.collection.mutable Package
  231. The scala.collection Package
  232. The scala.collection.concurrent Package
  233. The scala.collection.convert Package
  234. The scala.collection.generic Package
  235. Construction of Instances
  236. The Iterable Abstraction
  237. Polymorphic Methods
  238. Equality for Collections
  239. Nonstrict Collections: Views
  240. Recap and What’s Next
  241. 15. Visibility Rulesqueue
  242. Public Visibility: The Default
  243. Visibility Keywords
  244. Protected Visibility
  245. Private Visibility
  246. Scoped Private and Protected Visibility
  247. Recap and What’s Next
  248. 16. Scala’s Type System, Part Iqueue
  249. Parameterized Types
  250. Abstract Type Members and Concrete Type Aliases
  251. Comparing Abstract Type Members Versus Parameterized Types
  252. Type Bounds
  253. Upper Type Bounds
  254. Lower Type Bounds
  255. Context Bounds
  256. View Bounds
  257. Intersection and Union Types
  258. Intersection Types
  259. Union Types
  260. Phantom Types
  261. Structural Types
  262. Refined Types
  263. Existential Types (Obsolete)
  264. Recap and What’s Next
  265. 17. Scala’s Type System, Part IIqueue
  266. Match Types
  267. Dependently Typed Methods
  268. Dependent Method and Dependent Function Types
  269. Dependent Typing
  270. Path-Dependent Types
  271. Using this
  272. Using super
  273. Stable Paths
  274. Self-Type Declarations
  275. Type Projections
  276. More on Singleton Types
  277. Self-Recursive Types: F-Bounded Polymorphism
  278. Higher-Kinded Types
  279. Type Lambdas
  280. Polymorphic Functions
  281. Type Wildcard Versus Placeholder
  282. Recap and What’s Next
  283. 18. Advanced Functional Programmingqueue
  284. Algebraic Data Types
  285. Sum Types Versus Product Types
  286. Properties of Algebraic Data Types
  287. Final Thoughts on Algebraic Data Types
  288. Category Theory
  289. What Is a Category?
  290. Functor
  291. The Monad Endofunctor
  292. The Semigroup and Monoid Categories
  293. Recap and What’s Next
  294. 19. Tools For Concurrencyqueue
  295. The scala.sys.process Package
  296. Futures
  297. Robust, Scalable Concurrency with Actors
  298. Akka: Actors for Scala
  299. Actors: Final Thoughts
  300. Stream Processing
  301. Recap and What’s Next
  302. 20. Dynamic Invocation In Scalaqueue
  303. Structural Types Revisited
  304. A Motivating Example: ActiveRecord in Ruby on Rails
  305. Dynamic Invocation with the Dynamic Trait
  306. DSL Considerations
  307. Recap and What’s Next
  308. 21. Domain-Specific Languages In Scalaqueue
  309. Internal DSLs
  310. External DSLs with Parser Combinators
  311. About Parser Combinators
  312. A Payroll External DSL
  313. Internal Versus External DSLs: Final Thoughts
  314. Recap and What’s Next
  315. 22. Scala Tools And Librariesqueue
  316. Scala 3 Versions
  317. Command-Line Interface Tools
  318. Coursier
  319. Managing Java JDKs with Coursier
  320. The scalac Command-Line Tool
  321. The scala Command-Line Tool
  322. The scaladoc Command-Line Tool
  323. Other Scala Command-Line Tools
  324. Build Tools
  325. Integration with IDEs and Text Editors
  326. Using Notebook Environments with Scala
  327. Testing Tools
  328. Scala for Big Data: Apache Spark
  329. Typelevel Libraries
  330. Li Haoyi Libraries
  331. Java and Scala Interoperability
  332. Using Java Identifiers in Scala Code
  333. Scala Identifiers in Java Code
  334. Java Generics and Scala Parameterized Types
  335. Conversions Between Scala and Java Collections
  336. Java Lambdas Versus Scala Functions
  337. Annotations for JavaBean Properties and Other Purposes
  338. Recap and What’s Next
  339. 23. Application Designqueue
  340. Recap of What We Already Know
  341. Annotations
  342. Using @main Entry Points
  343. Design Patterns
  344. Creational Patterns
  345. Structural Patterns
  346. Behavioral Patterns
  347. Better Design with Design by Contract
  348. The Parthenon Architecture
  349. Recap and What’s Next
  350. 24. Metaprogramming: Macros And Reflectionqueue
  351. Scala Compile Time Reflection
  352. Java Runtime Reflection
  353. Scala Reflect API
  354. Type Class Derivation: Implementation Details
  355. Scala 3 Metaprogramming
  356. Inline
  357. Macros
  358. Staging
  359. Wrapping Up and Looking Ahead
  360. A. Significant Indentation Versus Braces Syntaxqueue
  361. Bibliography