| Quick Reference Scala CheatsheetScala 3 on one page — lists, Option, case classes, pattern matching, and the traps around ==, Array, and None. 10 sections 10 tables 14 code snippets Run a fileA file A list The names
This page is Scala 3. Akka, Spark, and Play are left out. Brace blocks still work in Scala 2. ListsThe first value Index zero List rules
OptionA fallback Empty rules
FunctionsA method A function value Call rules
Case classesA book What you get
Pattern matchingFirst page, or zero Match rules
For-comprehensionsKeep the long books How for translates
TypesA type after the name Type rules
Objects and traitsA singleton Sharing behavior
Interview trapsTraps worth memorising
Empty stays empty Compare the elements How to use this page: bind names with |