Scala is a general purpose programming language principally targeting the Java Virtual Machine. Designed to express common programming patterns in a concise, elegant, and type-safe way, it fuses both imperative and functional programming styles. Its key features are:
- Static typing
- Advanced type system with type inference and declaration-site variance
- Function types (including anonymous) which support lexical closures
- Pattern-matching
- Implicit parameters and conversions which support the typeclass and enrich-my-library patterns
- Mixin composition
- Full interoperability with Java
- Powerful concurrency constructs
- Advanced language constructs such as delimited continuations and an experimental macro system
For more information, see the official Scala Introduction and Scala Documentation.
To search for Scala symbols such as "=>" in Stack Overflow, you can use symbolhound search.
To search Scala documentation, you can use scalex.
Free Scala programming books and guides
- Programming in Scala, First Edition
- Scala By Example (PDF)
- A Scala Tutorial for Java programmers
- Scala for Java refugees
- Scala School
- Scala Tutorials
- Scala Tour
- Scala for the Impatient (first part available for free at http://typesafe.com/resources/free-books)
Stack Overflow Scala Tutorial
- Introduction to Scala
- Variables/values
- Methods
- Equal sign in methods
- Operator notation and the rules
- Multiple ways to define a method/function (leave parentheses in method calls)
- Unary operators
- Multiple parameter lists
- Right-associative method names
- Side effect free methods
- Missing parentheses at methods
- Why no i++ in Scala?
- How to mix punctuation with alphanumeric characters in method names?
- Shortcut methods (
+=
,-=
,*=
, ...) - List of "magic method" names (apply, unapply/unapplySeq, update)
- Named arguments / optional parameters
- Type inference in return type
- Difference between
##
andhashCode
- Literals, statements and blocks
- Loops/recursion
- Data structures / Collections
- Collections design tutorial
- Collection standard practice
- Immutable Collections
- Mutable Collections
- Lazy Collections
- Parallel Collections
- Conversions
- Memory footprint
- How are Scala collections able to return the correct collection type from an operation?
- For-comprehension
- Enumeration
- Pattern matching
- Explanation
-
Value binding (
x @ X
) / type binding (x: X
) - How to do a multi-match
- Guards
- How to match variables or values?
- How is pattern match implemented under the hood?
- Exhaustive pattern
- Assignment via pattern
- Pattern match in for-expressions
- Ignore cases / no default value
- Conjunction
- Pattern match PartialFunctions
- Match Regex
- Pattern matching with more than one match
- Classes, objects and types
- Difference between
class
andobject
- Why is
object
a Singleton? - Why are singleton objects more object orientated?
- Companion objects
- Difference between
class
andtype
- What's the difference between a class with a companion object and a class and object with the same name?
- Static initializer
- Constructor overloading
- Static data in non-objects
- How to get the static/runtime type of a class
- Type projection (
A#B
)
- Difference between
- Packages, imports and visibility identifiers
- Imports
- Packages
- Visibility
- Explanation
- Private constructors
- Private variables
- Inheritance
- Explanation
- Early initializer
- Extractors
- Explanation (Example: conjunctions)
-
Infix notation for type parameters (
X[A, B]
=>A X B
)
- Case classes
- Parameterized types
- How to declare them?
- Upper / lower bounds
- Unify numerics
- How to get around type erasure?
- Abstract Types vs Generics
- Variances
- Traits
- Self references
- Error handling
- Exceptions
- Option
- Either
- What to use?
- Type handling
- Annotations
- Functions/Function literals
- Explanation
- Functions vs methods
- Pass functions
- Currying
- PartialFunction
- Placeholder syntax and their replacement rules
- Placeholder syntax with right-associative methods
- Difference between
=> Type
,() => Type
andUnit => Type
- Functional Quicksort
-
Keyword
return
in higher order functions and performance problem with that - Function composition
- Closures in Scala
- Type safety
- Implicits
- Reflection
- What is a TypeTag and how do I use it?
- How to work with Reflection?
- Enrich-my-library pattern (formerly known as pimp-my-library)
- Concurrency overview
- Actors
- Use Java from Scala and vice versa
- XML literals
- Explanation
- Scala Swing
- Explanation
- Examples
- Type Programming
- Functional Scala
- Is immutability expensive?
- Is Scala functional programming slower than traditional coding?
- OOP in a purely FP context?
- Continuations
- Design patterns for functional-oo hybrid languages?
- Type programming
- Higher kinded types
- Type lambdas (
SomeType[({type λ[α] = Either[A, α]})#λ]
) - Virtual Classes
forall
in Scala
Further learning
- Learning Resources
- REPL
- Working with
scalac
andscala
- Operator precedence
- Scala blogs to follow
- Scala style
- Functional Programming Principles in Scala, a free functional programming course on Coursera taught by Martin Odersky, the creator of Scala
- Principles of Reactive Programming, a free reactive functional programming course on Coursera taught by Martin Odersky, Erik Meijer, Roland Kuhn.
相关推荐
**标题**: "Scala programming language.pdf" **描述**: "一本学习Scala语言的优秀教程,喜欢Scala的朋友千万不能错过" Scala是一种现代化的多范式编程语言,它融合了面向对象编程与函数式编程的特点。根据描述,...
本书由直接参与Scala开发的一线人员编写,因而对原理的解读和应用的把握更加值得信赖。本书面向具有一定编程经验的开发者,目标是让读者能够全面了解和掌握Scala编程语言的核心特性,并能够深入理解Scala这门语言在...
总之,《Programming in Scala》是一本非常有价值的书籍,无论你是初学者还是有经验的程序员,都能从中获得宝贵的知识和技能。通过本书的学习,你可以更好地理解和运用Scala这一强大而优雅的编程语言。
Harness reactive programming to build scalable and fault-tolerant distributed systems using Scala and Akka About This Book Use the concepts of reactive programming to build distributed systems ...
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 ...
Scala High Performance Programming 英文mobi 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Programming in Scala is the definitive book on Scala, the new language for the Java Platform that blends object-oriented and functional programming concepts into a unique and powerful tool for ...
《Programming In Scala》是一本权威的Scala编程语言教程,它由Martin Odersky(Scala的创造者)、Lex Spoon 和 Bill Venners 共同编写。中文版包含了1到13章的内容,这些章节涵盖了Scala的基础知识和基本应用,适合...
Spark itself is written with Scala and naturally, as a starting point, we will discuss a brief introduction to Scala, such as the basic aspects of its history, purposes, and how to install Scala on ...
- **标题**:“Programming.Scala” - **描述**:2009年7月发布的Scala教程。 **Scala**是一种多范式编程语言,结合了面向对象编程和函数式编程的概念。它被设计成能够与Java无缝集成,并在Java虚拟机(JVM)上运行...
This book introduces you to the Scala programming language its object oriented and functional programming characteristics and then guides you through Scala constructs and libraries that allow you to ...
《Functional Programming in Scala》与《Scala for the Impatient》是两本关于Scala编程语言的重要书籍,专注于函数式编程思想和Scala语言的深入学习。Scala是一种多范式编程语言,结合了面向对象和函数式编程的...
《Programming in Scala.pdf》是一本专注于Scala编程语言的书籍。Scala是一种现代的多范式编程语言,专为可扩展性而设计。该书旨在为读者提供深入理解Scala语言的教程。 ### 描述 描述中提及的内容表明,...
《Programming in Scala》第二版是一本全面详尽的Scala编程指南,由Scala语言的主要设计者Martin Odersky、Lex Spoon和Bill Venners共同撰写。本书是为Scala 2.8版本更新的,因此包含了最新的特性和技术改进。 ####...
This book is a tutorial for the Scala programming language, written by people directly involved in the development of Scala. Our goal is that by reading this book, you can learn everything you need to...
it guides you through dozens of powerful techniques example by example.About the Book Scala is a powerful JVM language that blends the functional and OO programming models. You'll have no trouble ...
注意是Programming Scala的第二版,而不是Programming in Scala的第二版,更注重于与Spark相关的知识!强烈推荐!Programming Scala- Scalability = Functional Programming + Objects, 2 edition