I finished "Functional Programming Principles in Scala" and for the first time in a long time I am excited about a new programming language.
Scala continues the ideas of OCaml: you can successfully combine object oriented and functional features in a language, mutable and immutable collections.
Here is a short summary about the language and the course.
What I liked about Scala #
- No statements, only expressions
- Operators are method calls
- Inferred types
- Powerful pattern matching
- Structural equality
- Rich built-in collections library
- Maps and sequences are functions (key => value or index => value), brilliant!
What I learned from the course #
Programming language ideas #
- Implicit Parameters
- Partial functions (not to be confused with partial application!)
- Call-by-name as a syntax (
f: => T)
- Covariance and contravariance
Computer science ideas #
- Huffman encoding
- how to think about fold left and fold right as a trees:
What surprised me #
- Coming from Flow, I expected union and intersection types, but they are scheduled only for Dotty
- In Scala community (at least in the FP part of it) it seems that the notions of Monoid and Semigroup are common knowledge
- "Scala exercises" to learn basic language and features
- "Scala with style" talk by Martin Odersky where he explains design decisions he made about the language